summaryrefslogtreecommitdiffstats
path: root/lib/resource.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-03-04 12:36:26 +0100
committerMartin Mares <mj@ucw.cz>1999-03-04 12:36:26 +0100
commit7a2105becdbadf20c1b4e4d2359e339c90610825 (patch)
tree524bc4947ec1938cd48e3ec6a44a9f66983f8e4b /lib/resource.c
parentaa64578641c15b137172acc927d9d7af5914576b (diff)
downloadbird-7a2105becdbadf20c1b4e4d2359e339c90610825.tar
bird-7a2105becdbadf20c1b4e4d2359e339c90610825.zip
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().
Diffstat (limited to 'lib/resource.c')
-rw-r--r--lib/resource.c9
1 files changed, 9 insertions, 0 deletions
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 <stdio.h>
#include <stdlib.h>
+#include <string.h>
#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)
{