diff options
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/memory.c b/memory.c new file mode 100644 index 0000000..952bedf --- /dev/null +++ b/memory.c @@ -0,0 +1,9 @@ +#include "global.h" +#include "memory.h" + +void* check_after_allocation(const char *func,size_t num,size_t sz,void *ptr){ + if(ptr==NULL){ + die("Allocation failed: %s(%zu * %zuB = %zu)",func,num,sz,num*sz); + } + return ptr; +} |