]> mj.ucw.cz Git - libucw.git/blob - lib/alloc.c
HTML parser basically works. A *lot* of things still needs to be cleaned up.
[libucw.git] / lib / alloc.c
1 /*
2  *      Sherlock Library -- Memory Allocation
3  *
4  *      (c) 2000 Martin Mares <mj@ucw.cz>
5  */
6
7 #include "lib/lib.h"
8
9 #include <stdlib.h>
10 #include <string.h>
11
12 void *
13 xmalloc(uns size)
14 {
15   void *x = malloc(size);
16   if (!x)
17     die("Cannot allocate %d bytes of memory", size);
18   return x;
19 }
20
21 void *
22 xmalloc_zero(uns size)
23 {
24   void *x = xmalloc(size);
25   bzero(x, size);
26   return x;
27 }