From 7a2105becdbadf20c1b4e4d2359e339c90610825 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 4 Mar 1999 11:36:26 +0000 Subject: Use dmalloc instead of EFence when available (dmalloc has lot of improvements over EFence and also hopefully smaller memory overhead, but sadly it's non-free for commercial use). If the DMALLOC_OPTIONS environment variable is not set, switch on `reasonable' checks by default. Also introduced mb_allocz() for cleared mb_alloc(). --- lib/resource.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/resource.c') diff --git a/lib/resource.c b/lib/resource.c index ce0ba14..f2a0c77 100644 --- a/lib/resource.c +++ b/lib/resource.c @@ -8,6 +8,7 @@ #include #include +#include #include "nest/bird.h" #include "lib/resource.h" @@ -156,6 +157,14 @@ mb_alloc(pool *p, unsigned size) return b->data; } +void * +mb_allocz(pool *p, unsigned size) +{ + void *x = mb_alloc(p, size); + bzero(x, size); + return x; +} + void mb_free(void *m) { -- cgit v1.2.3