summaryrefslogtreecommitdiff
path: root/bsd-core/drm_drv.c
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2008-10-10 13:06:22 -0400
committerRobert Noland <rnoland@2hip.net>2008-10-10 13:06:22 -0400
commitcdd3e9fc562bd57e0272e4c4d1c0707776bd01a1 (patch)
tree97d7b554a5c040630fabcb693b7b26ab4ca5a9f1 /bsd-core/drm_drv.c
parent1150a42d4398b14c5db2f34a5beba613528df147 (diff)
[FreeBSD] Rework all of the memory allocations
Allocate memory from different pools. This allows the OS to track memory allocations for us, much like the linux memory debugging. This will ease tracking down memory leaks since the OS can track the number of allocations from each pool and help to point us in the right direction. Also replace drm_alloc and friends with static __inline__ versions while we are here.
Diffstat (limited to 'bsd-core/drm_drv.c')
-rw-r--r--bsd-core/drm_drv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index a35d60a7..725e5a9d 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -280,7 +280,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;
}
@@ -288,7 +288,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;
}
@@ -310,7 +310,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;
@@ -479,7 +479,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;
}
@@ -623,7 +623,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