]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
Introduced obuck_get_pos(), converted gatherd limits to use it.
[libucw.git] / lib / alloc.c
index bec45d9b590f691050aa7722cc746af63c91c640..075321436c44f1dba1ffb54d5098d5248fd60b64 100644 (file)
@@ -7,6 +7,7 @@
 #include "lib/lib.h"
 
 #include <stdlib.h>
+#include <string.h>
 
 void *
 xmalloc(uns size)
@@ -16,3 +17,11 @@ xmalloc(uns size)
     die("Cannot allocate %d bytes of memory", size);
   return x;
 }
+
+void *
+xmalloc_zero(uns size)
+{
+  void *x = xmalloc(size);
+  bzero(x, size);
+  return x;
+}