#pragma once #include #define malloc(num, type) \ ((type*)check_after_allocation("malloc", malloc((num)*sizeof(type)))) #define calloc(num, type) \ ((type*)check_after_allocation("calloc", calloc((num), sizeof(type)))) #define realloc(ptr, num, type) \ ((type*)check_after_allocation("realloc", realloc(ptr, (num)*sizeof(type)))) void* check_after_allocation(const char *funcname, void *ptr);