Re: malloc_zone_t - overriding free/malloc
Re: malloc_zone_t - overriding free/malloc
- Subject: Re: malloc_zone_t - overriding free/malloc
- From: Glen Beane <email@hidden>
- Date: Fri, 15 Jul 2005 11:13:00 -0400
turns out there was a bug in my zone->size function
Also, sorry about the email below - looking at it now I see that the
last couple paragraphs really don't make any sense - &malloc
obviously isn't the same address as my malloc
malloc calls malloc_zone_malloc, and malloc_zone_malloc calls zone-
>malloc
I guess I wasn't thinking too clearly
On Jul 15, 2005, at 12:23 AM, Glen Beane wrote:
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:
40umcs.maine.edu
This email sent to email@hidden
_______________________________________________
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