This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Problem with __malloc_hooks :-(
>>>>> Wolfram Gloger writes:
Wolfram> Andreas wrote:
>> What I meant was: Using __malloc_hook internally in malloc.c to
>> initialize malloc and at the same time allowing the use to set
>> __malloc_hook is broken.
Wolfram> Well, better suggestions are welcome. I still think it's the only
Wolfram> portable way to solve the initialization problem. But, since this
Wolfram> check is run through with every call to malloc, free, realloc, etc.,
Wolfram> it is rather performance-critical. So I think using __malloc_hook
Wolfram> (which needs to be checked anyway) is a good compromise.
Ok, I'm convinced now.
>> Could somebody document this properly, please? <malloc.h> has only a
>> declaration of__malloc_initialize_hook - but no documentation at all.
>> The manual only mentions __malloc_hook. If we're going to declare
>> that __malloc_hook is only allowed to be set after malloc is
>> initialized and can be set from __malloc_initialize_hook, we should
>> document this.
Wolfram> I've now looked at the docs, and I agree 100%. I had a vague memory
Wolfram> that the GNU malloc docs mentioned that setting up the malloc hooks
Wolfram> required proper timing but due to the recent changes this has become
Wolfram> worse.
Wolfram> Give me a few days please, I will send a patch for the malloc hooks
Wolfram> docs and malloc.h.
Fine! Thanks,
Andreas
--
Andreas Jaeger aj@suse.de aj@arthur.rhein-neckar.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de