malloc_zone_t - overriding free/malloc
malloc_zone_t - overriding free/malloc
- Subject: malloc_zone_t - overriding free/malloc
- From: Glen Beane <email@hidden>
- Date: Fri, 15 Jul 2005 00:23:23 -0400
I use malloc_default_zone to get the default zone and then I overwrite
the pointers to malloc,calloc,valloc,realloc and free with pointers to
my own functions. My malloc gets called as I expect, but when I call
free I get the following error:
malloc: *** Deallocation of a pointer not malloced:
If I call my free directly instead it works as expected.
If I print &malloc, I get the address of my malloc, if I print &free I
see the original free. If I call malloc_default_zone and print the
pointer to free I see my free, not the default free.
Why is the original free being called rather than the function I stick
into the default_zone structure? malloc works as expected so I thought
I was doing this right.
Anyone know what I'm doing wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden