]> git.lizzy.rs Git - nothing.git/blob - src/system/nth_alloc.c
bcf946c6f219005ead768a942d166838abdf47ef
[nothing.git] / src / system / nth_alloc.c
1 #include <stdlib.h>
2 #include "nth_alloc.h"
3 #include "log.h"
4
5 void *nth_calloc(size_t num, size_t size)
6 {
7     void *mem = calloc(num, size);
8
9     if (mem == NULL) {
10         log_fail("nth_calloc(%lu, %lu) failed", num, size);
11     }
12
13     return mem;
14 }
15
16 void *nth_realloc(void *ptr, size_t new_size)
17 {
18     void *mem = realloc(ptr, new_size);
19
20     if (mem == NULL) {
21         log_fail("nth_realloc(0x%x, %lu) failed", ptr, new_size);
22     }
23
24     return mem;
25 }