Advertisement
| 05.12.2008 at 12:46AM PDT, ID: 23393869 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
void* malloc(size_t size)
{
static void* (*func)(size_t);
char str[200];
void *r;
if(!func) {
func = (void * (*)(size_t))dlsym(RTLD_NEXT, "malloc");
}
r = func(size);
if(firstRun) {
start_print();
firstRun = 0;
}
printf("m %p %i\n", r, size);
return r;
}
void* calloc(size_t nelem, size_t elsize)
{
static void* (*func)();
char str[200];
void *r;
if(!func) {
func = (void*(*)())dlsym(RTLD_NEXT, "calloc");
}
r = func(nelem, elsize);
printf("c %p %d %d\n", r, nelem, elsize);
return r;
}
|