This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
some question about malloc_hook
- From: yoma sophian <sophian dot yoma at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Wed, 3 Aug 2016 19:26:52 +0800
- Subject: some question about malloc_hook
- Authentication-results: sourceware.org; auth=none
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,