From 62e2943e17e1ff3f572b955909f45a61681c1379 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 21 Jul 2020 01:33:55 +0200 Subject: [PATCH] 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 --- man3/posix_memalign.3 | 7 ++++--- 1 file 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 () -- 2.47.2