From: Bruno Haible Date: Mon, 20 Jul 2020 23:33:55 +0000 (+0200) Subject: posix_memalign.3: Clarify how to free the result of posix_memalign X-Git-Tag: man-pages-5.08~44 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=62e2943e17e1ff3f572b955909f45a61681c1379;p=thirdparty%2Fman-pages.git 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 --- 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 ()