From d722a8bc9f36f4ff688377892f9f54e47ceb9ea4 Mon Sep 17 00:00:00 2001 From: Ivana Varekova Date: Tue, 19 Oct 2010 12:32:26 +0200 Subject: [PATCH] malloc_hook.3: Warn that these functions are deprecated Signed-off-by: Michael Kerrisk --- man3/malloc_hook.3 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/man3/malloc_hook.3 b/man3/malloc_hook.3 index 3a56f8fef..0e126459b 100644 --- a/man3/malloc_hook.3 +++ b/man3/malloc_hook.3 @@ -3,11 +3,7 @@ .\" Heavily based on glibc documentation .\" Polished, added docs, removed glibc doc bug, 2002-07-20, aeb .\" -.\" FIXME -.\" According to a Fedora downstream patch, malloc hooks are deprecated -.\" https://bugzilla.redhat.com/show_bug.cgi?id=450187 -.\" Integrate this upstream? -.TH MALLOC_HOOK 3 2002-07-20 "GNU" "Linux Programmer's Manual" +.TH MALLOC_HOOK 3 2010-10-13 "GNU" "Linux Programmer's Manual" .SH NAME __malloc_hook, __malloc_initialize_hook, __memalign_hook, __free_hook, __realloc_hook, @@ -79,6 +75,12 @@ points at a function that is called each time after was asked for more memory. .SH "CONFORMING TO" These functions are GNU extensions. +.SH NOTES +The use of these hook functions is not safe in multithreaded programs, +and they are now deprecated. +.\" https://bugzilla.redhat.com/show_bug.cgi?id=450187 +Programmers should instead preempt calls to the relevant functions +by defining and exporting functions such as "malloc" and "free". .SH "EXAMPLE" Here is a short example of how to use these variables. .sp