]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
prune the original source code yet more
[libucw.git] / lib / alloc.c
index 127e63cabfcd4ead9b62e5d4206b3e4aa63aee1f..21d9635778daf3974132f1fc6f13df82523f78a4 100644 (file)
@@ -1,13 +1,18 @@
 /*
  *     Sherlock Library -- Memory Allocation
  *
- *     (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ *     (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 <stdio.h>
+#include "lib/lib.h"
+
 #include <stdlib.h>
+#include <string.h>
 
-#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;
+}