summaryrefslogtreecommitdiffstats
path: root/man3/malloc_hook.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
commit3af6d22bb3850ab2bac67287e3a3d3b0e32868e5 (patch)
tree3ee7a3ec64525911fa865bb984c86d997d855527 /man3/malloc_hook.3
parentAdding debian version 6.05.01-1. (diff)
downloadmanpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.tar.xz
manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.zip
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'man3/malloc_hook.3')
-rw-r--r--man3/malloc_hook.326
1 files changed, 13 insertions, 13 deletions
diff --git a/man3/malloc_hook.3 b/man3/malloc_hook.3
index 8ade1b1..bb1aa69 100644
--- a/man3/malloc_hook.3
+++ b/man3/malloc_hook.3
@@ -5,7 +5,7 @@
.\" Heavily based on glibc documentation
.\" Polished, added docs, removed glibc doc bug, 2002-07-20, aeb
.\"
-.TH __malloc_hook 3 2023-05-03 "Linux man-pages 6.05.01"
+.TH __malloc_hook 3 2023-10-31 "Linux man-pages 6.7"
.SH NAME
__malloc_hook, __malloc_initialize_hook,
__memalign_hook, __free_hook, __realloc_hook,
@@ -16,19 +16,19 @@ Standard C library
.SH SYNOPSIS
.nf
.B "#include <malloc.h>"
-.PP
+.P
.BI "void *(*volatile __malloc_hook)(size_t " size ", const void *" caller );
-.PP
+.P
.BI "void *(*volatile __realloc_hook)(void *" ptr ", size_t " size ,
.BI " const void *" caller );
-.PP
+.P
.BI "void *(*volatile __memalign_hook)(size_t " alignment ", size_t " size ,
.BI " const void *" caller );
-.PP
+.P
.BI "void (*volatile __free_hook)(void *" ptr ", const void *" caller );
-.PP
+.P
.B "void (*__malloc_initialize_hook)(void);"
-.PP
+.P
.B "void (*volatile __after_morecore_hook)(void);"
.fi
.SH DESCRIPTION
@@ -41,24 +41,24 @@ by specifying appropriate hook functions.
You can use these hooks
to help you debug programs that use dynamic memory allocation,
for example.
-.PP
+.P
The variable
.B __malloc_initialize_hook
points at a function that is called once when the malloc implementation
is initialized.
This is a weak variable, so it can be overridden in
the application with a definition like the following:
-.PP
+.P
.in +4n
.EX
void (*__malloc_initialize_hook)(void) = my_init_hook;
.EE
.in
-.PP
+.P
Now the function
.IR my_init_hook ()
can do the initialization of all hooks.
-.PP
+.P
The four functions pointed to by
.BR __malloc_hook ,
.BR __realloc_hook ,
@@ -74,7 +74,7 @@ respectively, except that they have a final argument
that gives the address of the caller of
.BR malloc (3),
etc.
-.PP
+.P
The variable
.B __after_morecore_hook
points at a function that is called each time after
@@ -101,7 +101,7 @@ and
.BR calloc ().
.SH EXAMPLES
Here is a short example of how to use these variables.
-.PP
+.P
.EX
#include <stdio.h>
#include <malloc.h>