X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Falloc.c;h=21d9635778daf3974132f1fc6f13df82523f78a4;hb=bcfb15368033a922fa375d78fb84269e1f9ab11a;hp=127e63cabfcd4ead9b62e5d4206b3e4aa63aee1f;hpb=5b53087fa5a07ff89d34cf3bf3bc1b28809f05c2;p=libucw.git diff --git a/lib/alloc.c b/lib/alloc.c index 127e63ca..21d96357 100644 --- a/lib/alloc.c +++ b/lib/alloc.c @@ -1,13 +1,18 @@ /* * 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/lib.h" +#ifndef DEBUG_DMALLOC void * xmalloc(uns size) @@ -17,3 +22,13 @@ xmalloc(uns 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; +}