diff options
author | rnoland <rnoland@FreeBSD.org> | 2008-10-13 18:03:27 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2008-10-13 18:03:27 +0000 |
commit | 192b3600be5db1effa54d2e72717a7482aaeb52a (patch) | |
tree | 9afb72dec01dcbe8a080c5adf1bdbdde1abd41bd /sys/dev/drm/drm_scatter.c | |
parent | 0d37976f3d86d7805a29299cc21e4b517b824aac (diff) | |
download | FreeBSD-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_scatter.c')
-rw-r--r-- | sys/dev/drm/drm_scatter.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/drm/drm_scatter.c b/sys/dev/drm/drm_scatter.c index a8c379f..c94976a 100644 --- a/sys/dev/drm/drm_scatter.c +++ b/sys/dev/drm/drm_scatter.c @@ -43,9 +43,9 @@ __FBSDID("$FreeBSD$"); void drm_sg_cleanup(drm_sg_mem_t *entry) { - free((void *)entry->handle, M_DRM); - free(entry->busaddr, M_DRM); - free(entry, M_DRM); + free((void *)entry->handle, DRM_MEM_PAGES); + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); } int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) @@ -57,7 +57,7 @@ int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) if (dev->sg) return EINVAL; - entry = malloc(sizeof(*entry), M_DRM, M_WAITOK | M_ZERO); + entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); if (!entry) return ENOMEM; @@ -66,14 +66,14 @@ int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) entry->pages = pages; - entry->busaddr = malloc(pages * sizeof(*entry->busaddr), M_DRM, + entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES, M_WAITOK | M_ZERO); if (!entry->busaddr) { drm_sg_cleanup(entry); return ENOMEM; } - entry->handle = (long)malloc(pages << PAGE_SHIFT, M_DRM, + entry->handle = (long)malloc(pages << PAGE_SHIFT, DRM_MEM_PAGES, M_WAITOK | M_ZERO); if (entry->handle == 0) { drm_sg_cleanup(entry); |