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_dma.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_dma.c')
-rw-r--r-- | sys/dev/drm/drm_dma.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/drm/drm_dma.c b/sys/dev/drm/drm_dma.c index e630c25..f99b16b 100644 --- a/sys/dev/drm/drm_dma.c +++ b/sys/dev/drm/drm_dma.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); int drm_dma_setup(struct drm_device *dev) { - dev->dma = malloc(sizeof(*dev->dma), M_DRM, M_NOWAIT | M_ZERO); + dev->dma = malloc(sizeof(*dev->dma), DRM_MEM_DRIVER, M_NOWAIT | M_ZERO); if (dev->dma == NULL) return ENOMEM; @@ -70,21 +70,21 @@ void drm_dma_takedown(struct drm_device *dev) for (j = 0; j < dma->bufs[i].seg_count; j++) { drm_pci_free(dev, dma->bufs[i].seglist[j]); } - free(dma->bufs[i].seglist, M_DRM); + free(dma->bufs[i].seglist, DRM_MEM_SEGS); } if (dma->bufs[i].buf_count) { for (j = 0; j < dma->bufs[i].buf_count; j++) { free(dma->bufs[i].buflist[j].dev_private, - M_DRM); + DRM_MEM_BUFS); } - free(dma->bufs[i].buflist, M_DRM); + free(dma->bufs[i].buflist, DRM_MEM_BUFS); } } - free(dma->buflist, M_DRM); - free(dma->pagelist, M_DRM); - free(dev->dma, M_DRM); + free(dma->buflist, DRM_MEM_BUFS); + free(dma->pagelist, DRM_MEM_PAGES); + free(dev->dma, DRM_MEM_DRIVER); dev->dma = NULL; DRM_SPINUNINIT(&dev->dma_lock); } |