]> mj.ucw.cz Git - moe.git/blob - ucw/realloc.c
Isolate: Cleanups, configuration and TODO
[moe.git] / ucw / 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 "ucw/lib.h"
11
12 #include <stdlib.h>
13
14 void *
15 xrealloc(void *old, uns size)
16 {
17   /* We assume that realloc(NULL, x) works like malloc(x), which is true with the glibc. */
18   void *x = realloc(old, size);
19   if (!x)
20     die("Cannot reallocate %d bytes of memory", size);
21   return x;
22 }