summaryrefslogtreecommitdiff
path: root/bsd-core
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core')
-rw-r--r--bsd-core/drmP.h1
-rw-r--r--bsd-core/drm_memory.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index ff4cd895..9cd41b8d 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -401,6 +401,7 @@ extern int DRM(version)( DRM_IOCTL_ARGS );
extern void DRM(mem_init)(void);
extern void DRM(mem_uninit)(void);
extern void *DRM(alloc)(size_t size, int area);
+extern void *DRM(calloc)(size_t nmemb, size_t size, int area);
extern void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size,
int area);
extern void DRM(free)(void *pt, size_t size, int area);
diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c
index edd9ffa6..dc0d3753 100644
--- a/bsd-core/drm_memory.c
+++ b/bsd-core/drm_memory.c
@@ -58,6 +58,11 @@ void *DRM(alloc)(size_t size, int area)
return malloc(size, DRM(M_DRM), M_NOWAIT);
}
+void *DRM(calloc)(size_t nmemb, size_t size, int area)
+{
+ return malloc(size * nmemb, DRM(M_DRM), M_NOWAIT | M_ZERO);
+}
+
void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area)
{
void *pt;