> Or even better, how can I successfully use __malloc_hook while running
> under Valgrind?

You cannot.  "man 3 malloc_hook" says "These functions are GNU extensions."
Memcheck's implementation of malloc has "nothing to do" with glibc's
implementation, except of course the C89/C99 syntax and semantics,
which do not include __malloc_hook.  Using something such as __malloc_hook
presumes that you have an agreement with the implementor of malloc,
and obviously you don't have that agreement when malloc is implemented
by memcheck.  (The "__" double underscore prefix to '__malloc_hook'
*tells* you that you are doing something "naughty"; read the standard!)

In order to use memcheck, then the program must use only the standard
semantics of malloc, free, calloc, realloc, memalign, posix_memalign.
Also see the NOTES: "The use of these hook functions is not safe in
multithreaded programs, and they are now deprecated."

-- 


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to