This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with __malloc_hooks :-(


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.

Well, better suggestions are welcome.  I still think it's the only
portable way to solve the initialization problem.  But, since this
check is run through with every call to malloc, free, realloc, etc.,
it is rather performance-critical.  So I think using __malloc_hook
(which needs to be checked anyway) is a good compromise.

> 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.

I've now looked at the docs, and I agree 100%.  I had a vague memory
that the GNU malloc docs mentioned that setting up the malloc hooks
required proper timing but due to the recent changes this has become
worse.

Give me a few days please, I will send a patch for the malloc hooks
docs and malloc.h.

Regards,
Wolfram.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]