On Tue, 2003-09-30 at 03:42, WA Support wrote: > Hello, > > > Robert Collins wrote: > > > code in squid cannot use alloc, malloc, calloc, or free. They must use > > xalloc, xcalloc, xfree, or mempools, or cbdata. > > These wrappers help prevent common allocation bugs, as well as > > introducing refcounting, slab allocation and the like (depending on > > which specific thing is used). > > > > Sorry about my ignorance here, but I don't understand how to wrap the > MySQL header, my_alloc.h, so it can be used in squid code. Also, I am > not sure how to use cbdata with my_alloc.h. I have read what > documentation I can find on cbdata, but I am still not clear. I have > also looked at List.h, but can't figure out how cbdata is being used. > At least not with respect to modifying my_alloc.h. > > I hate to be such a bother here, but could you please give me an example > of how to wrap my_alloc.h or use cbdata with it? > > I have included code for my_alloc.h down to the 'offending line': ... > I also have the code for my_alloc.c if that would be helpful. > > I just don't know where to go from here, so please excuse my flailing.
The minimum changes would be to: * change all internal uses of alloc/malloc to xmalloc, free to cfree. * change any variables called free to something else - i.e. my_free. * change any functions likewise. Hope that helps. Cheers, Rob -- GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.
signature.asc
Description: This is a digitally signed message part
