some question about malloc_hook

yoma sophian sophian.yoma@gmail.com
Wed Aug 3 11:27:00 GMT 2016


hi all:
When I check below manual, it shows we can use  __malloc_hook and
__realloc_hook debug programsthat use dynamic memory allocation.
http://www.gnu.org/software/libc/manual/pdf/libc.pdf

But when I copy the sample code and try to compile for running.
it say
malloc_hook.c:12:1: warning: ‘__malloc_hook’ is deprecated (declared
at /media/sdb2/toolchain/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08_linux/arm-linux-gnueabihf/libc/usr/include/malloc.h:153)
[-Wdeprecated-declarations]

if __malloc_hook and __realloc_hook are really deprecated,
is there similar methods we can use to hook malloc, realloc instead?

appreciate your kind help in advance,



More information about the Libc-help mailing list