X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Falloc.c;h=678901a98e834f330d38c97fefb7f999982afc86;hb=63b7d5c6c89182792601e29326131e6b12321df9;hp=075321436c44f1dba1ffb54d5098d5248fd60b64;hpb=2c27563b528310adb8c5216161953171a664043b;p=libucw.git diff --git a/lib/alloc.c b/lib/alloc.c index 07532143..678901a9 100644 --- a/lib/alloc.c +++ b/lib/alloc.c @@ -1,7 +1,10 @@ /* - * Sherlock Library -- Memory Allocation + * UCW Library -- Memory Allocation * * (c) 2000 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #include "lib/lib.h" @@ -9,6 +12,8 @@ #include #include +#ifndef DEBUG_DMALLOC + void * xmalloc(uns size) { @@ -18,6 +23,8 @@ xmalloc(uns size) return x; } +#endif + void * xmalloc_zero(uns size) { @@ -25,3 +32,14 @@ xmalloc_zero(uns size) bzero(x, size); return x; } + +void +xfree(void *ptr) +{ + /* + * Maybe it is a little waste of resources to make this a function instead + * of a macro, but xmalloc() is not used for anything critical anyway, + * so let's prefer simplicity. + */ + free(ptr); +}