Re: malloc_zone_t - overriding free/malloc
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Mozilla Thunderbird 0.5 (Windows/20040207) Glen Beane wrote: malloc: *** Deallocation of a pointer not malloced: If I call my free directly instead it works as expected. This email sent to beaneg@umcs.maine.edu _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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... 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: 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/beaneg%40umcs.maine.edu This email sent to site_archiver@lists.apple.com
participants (1)
-
Glen Beane