summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_drv.c
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-10-13 18:03:27 +0000
committerrnoland <rnoland@FreeBSD.org>2008-10-13 18:03:27 +0000
commit192b3600be5db1effa54d2e72717a7482aaeb52a (patch)
tree9afb72dec01dcbe8a080c5adf1bdbdde1abd41bd /sys/dev/drm/drm_drv.c
parent0d37976f3d86d7805a29299cc21e4b517b824aac (diff)
downloadFreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.zip
FreeBSD-src-192b3600be5db1effa54d2e72717a7482aaeb52a.tar.gz
Rework memory allocation to allocate memory with different type names. This
will ease the identification of memory leaks as the OS will be able to track allocations for us by malloc type. vmstat -m will show all of the allocations. Convert the calls to drm_alloc() and friends, which are used in shared code to static __inline__ while we are here. Approved by: jhb (mentor)
Diffstat (limited to 'sys/dev/drm/drm_drv.c')
-rw-r--r--sys/dev/drm/drm_drv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index 4cabc7e..0d8e60f 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -283,7 +283,7 @@ static int drm_lastclose(struct drm_device *dev)
drm_irq_uninstall(dev);
if (dev->unique) {
- free(dev->unique, M_DRM);
+ free(dev->unique, DRM_MEM_DRIVER);
dev->unique = NULL;
dev->unique_len = 0;
}
@@ -291,7 +291,7 @@ static int drm_lastclose(struct drm_device *dev)
for (i = 0; i < DRM_HASH_SIZE; i++) {
for (pt = dev->magiclist[i].head; pt; pt = next) {
next = pt->next;
- free(pt, M_DRM);
+ free(pt, DRM_MEM_MAGIC);
}
dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
}
@@ -313,7 +313,7 @@ static int drm_lastclose(struct drm_device *dev)
if (entry->bound)
drm_agp_unbind_memory(entry->handle);
drm_agp_free_memory(entry->handle);
- free(entry, M_DRM);
+ free(entry, DRM_MEM_AGPLISTS);
}
dev->agp->memory = NULL;
@@ -482,7 +482,7 @@ static void drm_unload(struct drm_device *dev)
}
if (dev->agp) {
- free(dev->agp, M_DRM);
+ free(dev->agp, DRM_MEM_AGPLISTS);
dev->agp = NULL;
}
@@ -626,7 +626,7 @@ void drm_close(void *data)
if (dev->driver->postclose != NULL)
dev->driver->postclose(dev, file_priv);
TAILQ_REMOVE(&dev->files, file_priv, link);
- free(file_priv, M_DRM);
+ free(file_priv, DRM_MEM_FILES);
/* ========================================================
* End inline drm_release
OpenPOWER on IntegriCloud