Commit | Line | Data |
---|---|---|
a24bd519 | 1 | #include <malloc.h> |
7059478f | 2 | #include <stdio.h> |
a24bd519 LM |
3 | #include <stdlib.h> |
4 | ||
5 | #include "debug.h" | |
6 | ||
7 | #include "alloc.h" | |
8 | ||
9 | /* calloc or die function */ | |
10 | ||
11 | void *callocordie (size_t count, size_t size) | |
12 | { | |
13 | if (count * size == 0) { | |
14 | return NULL; | |
15 | } | |
16 | void *new = calloc (count, size); | |
17 | if (new == NULL) { | |
18 | VERBOSE (ERROR, fprintf (stderr, "can't allocate memory\n")); | |
19 | exit (1); | |
20 | } | |
21 | return new; | |
22 | } | |
23 | ||
24 | /* vim: set ts=4 sw=4 et: */ |