From a7aebb6dac3287374721dd2101a4584f12c63c82 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 29 Aug 2003 19:16:13 +0000 Subject: Add DRM(calloc), which is convenient, used by the new sis code, and takes advantage of M_ZERO on BSDs. --- linux-core/drm_memory_debug.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'linux-core/drm_memory_debug.h') diff --git a/linux-core/drm_memory_debug.h b/linux-core/drm_memory_debug.h index 3ef2a05c..fae419ec 100644 --- a/linux-core/drm_memory_debug.h +++ b/linux-core/drm_memory_debug.h @@ -167,6 +167,17 @@ void *DRM(alloc)(size_t size, int area) return pt; } +void *DRM(calloc)(size_t size, size_t nmemb, int area) +{ + void *addr; + + addr = DRM(alloc)(nmemb * size, area); + if (addr != NULL) + memset((void *)addr, 0, size * nmemb); + + return addr; +} + void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area) { void *pt; -- cgit v1.2.3