]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
posix_memalign.3: Clarify how to free the result of posix_memalign
authorBruno Haible <bruno@clisp.org>
Mon, 20 Jul 2020 23:33:55 +0000 (01:33 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 21 Jul 2020 10:45:20 +0000 (12:45 +0200)
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>
man3/posix_memalign.3

index 22b44982026b1e4384788344806b055abfc2edaa..2a8e5e61ebad0631d5c71763723f9ff80cb6315f 100644 (file)
@@ -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 ()