/* This file is in the public domain. */ #include "malwrap.h" #define GETPC(pc) asm volatile("movl 4(%%ebp), %0" : "=r"(pc) : ) void *__wrap_malloc(size_t nb) { unsigned int pc; GETPC(pc); return(wrapped_malloc(nb,pc)); } void *__wrap_calloc(size_t a, size_t b) { unsigned int pc; GETPC(pc); return(wrapped_calloc(a,b,pc)); } void *__wrap_realloc(void *blk, size_t nb) { unsigned int pc; GETPC(pc); return(wrapped_realloc(blk,nb,pc)); } void __wrap_free(void *blk) { unsigned int pc; GETPC(pc); wrapped_free(blk,pc); }