X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Falloc.c;h=21d9635778daf3974132f1fc6f13df82523f78a4;hb=5815f75d01bb508be9e8a9aacf954e2db7c983bb;hp=65594669234328ad0316a2b956d2434f815479b9;hpb=03846211ba84582b133a985200502a39462dfe66;p=libucw.git diff --git a/lib/alloc.c b/lib/alloc.c index 65594669..21d96357 100644 --- a/lib/alloc.c +++ b/lib/alloc.c @@ -1,19 +1,34 @@ /* * Sherlock Library -- Memory Allocation * - * (c) 1997 Martin Mares, + * (c) 2000 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ -#include +#include "lib/lib.h" + #include +#include -#include "lib.h" +#ifndef DEBUG_DMALLOC void * xmalloc(uns size) { void *x = malloc(size); if (!x) - die("Cannot allocate %d bytes of memory", size); + die("Cannot allocate %d bytes of memory", size); + return x; +} + +#endif + +void * +xmalloc_zero(uns size) +{ + void *x = xmalloc(size); + bzero(x, size); return x; }