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_pci.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_pci.c')
-rw-r--r-- | sys/dev/drm/drm_pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/drm/drm_pci.c b/sys/dev/drm/drm_pci.c index 7f8bc9f..868e1fe 100644 --- a/sys/dev/drm/drm_pci.c +++ b/sys/dev/drm/drm_pci.c @@ -67,7 +67,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, return NULL; } - dmah = malloc(sizeof(drm_dma_handle_t), M_DRM, M_ZERO | M_NOWAIT); + dmah = malloc(sizeof(drm_dma_handle_t), DRM_MEM_DMA, M_ZERO | M_NOWAIT); if (dmah == NULL) return NULL; @@ -86,7 +86,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */ &dmah->tag); if (ret != 0) { - free(dmah, M_DRM); + free(dmah, DRM_MEM_DMA); return NULL; } @@ -94,7 +94,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); - free(dmah, M_DRM); + free(dmah, DRM_MEM_DMA); return NULL; } @@ -103,7 +103,7 @@ drm_pci_alloc(struct drm_device *dev, size_t size, if (ret != 0) { bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); - free(dmah, M_DRM); + free(dmah, DRM_MEM_DMA); return NULL; } @@ -122,7 +122,7 @@ drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah) bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); - free(dmah, M_DRM); + free(dmah, DRM_MEM_DMA); } /*@}*/ |