]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
prune the original source code yet more
[libucw.git] / lib / alloc.c
index bec45d9b590f691050aa7722cc746af63c91c640..21d9635778daf3974132f1fc6f13df82523f78a4 100644 (file)
@@ -2,11 +2,17 @@
  *     Sherlock 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"
 
 #include <stdlib.h>
+#include <string.h>
+
+#ifndef DEBUG_DMALLOC
 
 void *
 xmalloc(uns size)
@@ -16,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;
+}