blob: 33554a9ac94c32943cb67412dfe0d61c18654fff (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "include/util.h"
void* ecalloc(size_t nmemb, size_t size) {
void* p;
if (! (p = calloc(nmemb, size))) { DIE("Failed to calloc:"); }
return p;
}
void* emalloc(size_t size) {
void* p;
if (! (p = malloc(size))) { DIE("Failed to malloc:"); }
return p;
}
void* erealloc(void* dest, size_t size) {
void* p;
if (! (p = realloc(dest, size))) { DIE("Failed to realloc:"); }
return p;
}
|