#include extern void *__real_malloc(size_t size); void *__wrap_malloc(size_t size) { // before call to malloc void *ret = __real_malloc(size); // after call to malloc return ret; }