]> mj.ucw.cz Git - libucw.git/blob - lib/realloc.c
Setting of LIBS is no longer necessary.
[libucw.git] / lib / realloc.c
1 /*
2  *      UCW Library -- Memory Re-allocation
3  *
4  *      (c) 1997 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include "lib/lib.h"
11
12 #include <stdlib.h>
13
14 #ifndef DEBUG_DMALLOC
15
16 void *
17 xrealloc(void *old, uns size)
18 {
19   /* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */
20   void *x = realloc(old, size);
21   if (!x)
22     die("Cannot reallocate %d bytes of memory", size);
23   return x;
24 }
25
26 #endif