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 01:24:29 -0400
OK, I was tired when I wrote that... that bit about &malloc showing the
address of my malloc doesn't even sense.
anyway I've dug through malloc.c and I figured out why I was getting
that error, now I just need to figure out how to fix it...
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:
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