]> git.ipfire.org Git - thirdparty/bird.git/blob - lib/xmalloc.c
2bec260c721ca41dadd08f39c2685093547e527c
[thirdparty/bird.git] / lib / xmalloc.c
1 /*
2 * BIRD Library -- malloc() With Checking
3 *
4 * (c) 1998--1999 Martin Mares <mj@ucw.cz>
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
9 #include <stdlib.h>
10
11 #include "nest/bird.h"
12 #include "lib/resource.h"
13
14 #ifndef HAVE_LIBDMALLOC
15
16 void *
17 xmalloc(unsigned size)
18 {
19 void *p = malloc(size);
20 if (p)
21 return p;
22 die("Unable to allocate %d bytes of memory", size);
23 }
24
25 #endif