]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
Added bit_array_assign(), replaced BIT_ARRAY_ALLOC by functions.
[libucw.git] / lib / alloc.c
index 075321436c44f1dba1ffb54d5098d5248fd60b64..678901a98e834f330d38c97fefb7f999982afc86 100644 (file)
@@ -1,7 +1,10 @@
 /*
- *     Sherlock Library -- Memory Allocation
+ *     UCW Library -- Memory Allocation
  *
  *     (c) 2000 Martin Mares <mj@ucw.cz>
+ *
+ *     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 <stdlib.h>
 #include <string.h>
 
+#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);
+}