aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-07-21 01:33:55 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-07-21 12:45:20 +0200
commit62e2943e17e1ff3f572b955909f45a61681c1379 (patch)
tree807287f695d2d106476b17254b9dc9f464a328f1 /man3
parent8c464d172c1d13365c60a18b8c295036ab29efa4 (diff)
downloadman-pages-62e2943e17e1ff3f572b955909f45a61681c1379.tar.gz
posix_memalign.3: Clarify how to free the result of posix_memalign
The man page did not tell how a memory block obtained through posix_memalign() can be freed. POSIX:2018 says it. https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html I verified using a test program that this is true for glibc. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
-rw-r--r--man3/posix_memalign.37
1 files changed, 4 insertions, 3 deletions
diff --git a/man3/posix_memalign.3 b/man3/posix_memalign.3
index 22b4498202..2a8e5e61eb 100644
--- a/man3/posix_memalign.3
+++ b/man3/posix_memalign.3
@@ -91,15 +91,16 @@ The address of the allocated memory will be a multiple of
.IR "alignment" ,
which must be a power of two and a multiple of
.IR "sizeof(void\ *)" .
+This address can later be successfully passed to
+.BR free (3).
If
.I size
is 0, then
the value placed in
.IR "*memptr"
-is either NULL,
+is either NULL
.\" glibc does this:
-or a unique pointer value that can later be successfully passed to
-.BR free (3).
+or a unique pointer value.
.PP
The obsolete function
.BR memalign ()