diff mbox series

[09/22] malloc_hook.3: SYNOPSIS: Use 'volatile' in prototypes

Message ID 20210305235105.177359-10-alx.manpages@gmail.com
State Not Applicable
Headers show
Series man3: SYNOPSIS: Use 'restrict' in prototypes (batch 3) | expand

Commit Message

Alejandro Colomar \(man-pages\) March 5, 2021, 11:50 p.m. UTC
glibc uses 'volatile' in __malloc_hook, __realloc_hook,
__memalign_hook, __free_hook, and __after_morecore_hook.
Let's use it here too.

.../glibc$ find * -type f \
  |grep '\.h$' \
  |xargs pcregrep -Mn '(?s)\b__malloc_hook\b.*?;';
malloc/malloc.h:168:
extern void *(*__MALLOC_HOOK_VOLATILE __malloc_hook)(size_t __size,
                                                     const void *)
__MALLOC_DEPRECATED;
.../glibc$ find * -type f \
  |grep '\.h$' \
  |xargs pcregrep -Mn '(?s)\b__realloc_hook\b.*?;';
malloc/malloc.h:171:
extern void *(*__MALLOC_HOOK_VOLATILE __realloc_hook)(void *__ptr,
                                                      size_t __size,
                                                      const void *)
__MALLOC_DEPRECATED;
.../glibc$ find * -type f \
 |grep '\.h$' \
 |xargs pcregrep -Mn '(?s)\b__memalign_hook\b.*?;';
malloc/malloc.h:175:
extern void *(*__MALLOC_HOOK_VOLATILE __memalign_hook)(size_t __alignment,
                                                       size_t __size,
                                                       const void *)
__MALLOC_DEPRECATED;
.../glibc$ find * -type f \
  |grep '\.h$' \
  |xargs pcregrep -Mn '(?s)\b__free_hook\b.*?;';
malloc/malloc.h:165:
extern void (*__MALLOC_HOOK_VOLATILE __free_hook) (void *__ptr,
                                                   const void *)
__MALLOC_DEPRECATED;
.../glibc$ find * -type f \
  |grep '\.h$' \
  |xargs pcregrep -Mn '(?s)\*\w*\s*\b__malloc_initialize_hook\b.*?;';
malloc/malloc-hooks.h:22:
void (*__malloc_initialize_hook) (void);
.../glibc$ find * -type f \
  |grep '\.h$' \
  |xargs pcregrep -Mn '(?s)\*\w*\s*\b__after_morecore_hook\b.*?;';
malloc/malloc.h:179:
extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void)
  __MALLOC_DEPRECATED;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/malloc_hook.3 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/man3/malloc_hook.3 b/man3/malloc_hook.3
index 7f1e35043..74c493c83 100644
--- a/man3/malloc_hook.3
+++ b/man3/malloc_hook.3
@@ -16,19 +16,19 @@  __after_morecore_hook \- malloc debugging variables
 .nf
 .B "#include <malloc.h>"
 .PP
-.BI "void *(*__malloc_hook)(size_t " size ", const void *" caller );
+.BI "void *(*volatile __malloc_hook)(size_t " size ", const void *" caller );
 .PP
-.BI "void *(*__realloc_hook)(void *" ptr ", size_t " size \
+.BI "void *(*volatile __realloc_hook)(void *" ptr ", size_t " size \
 ", const void *" caller );
 .PP
-.BI "void *(*__memalign_hook)(size_t " alignment ", size_t " size ,
+.BI "void *(*volatile __memalign_hook)(size_t " alignment ", size_t " size ,
 .BI "                         const void *" caller );
 .PP
-.BI "void (*__free_hook)(void *" ptr ", const void *" caller );
+.BI "void (*volatile __free_hook)(void *" ptr ", const void *" caller );
 .PP
 .B "void (*__malloc_initialize_hook)(void);"
 .PP
-.B "void (*__after_morecore_hook)(void);"
+.B "void (*volatile __after_morecore_hook)(void);"
 .fi
 .SH DESCRIPTION
 The GNU C library lets you modify the behavior of