#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; } void* check_after_allocation_str(const char *func,void *ptr){ if(ptr==NULL){ die("Allocation failed: %s()",func); } return ptr; }