From 315c821421a2279d77e846bf927b7c4107e32d43 Mon Sep 17 00:00:00 2001 From: John Scott Date: Thu, 21 Oct 2021 05:20:55 -0400 Subject: [PATCH] manual: remove an obsolete requirement on aligned_alloc() usage The C11 standard made it undefined behavior if the size of the allocation was not a multiple of the page size. As discussed at BZ #20137, changes to the standard were proposed and subsequently adopted in Defect Report 460. In particular, the following sentence "The value of alignment shall be a valid alignment supported by the implementation and the value of size shall be an integral multiple of alignment." was changed to "If the value of alignment is not a valid alignment supported by the implementation the function shall fail by returning a null pointer." The DR is at http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_460 --- manual/memory.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/memory.texi b/manual/memory.texi index 0b2b9c87..5c16f7ae 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -995,7 +995,7 @@ power of two than that, use @code{aligned_alloc} or @code{posix_memalign}. @c Alias to memalign. The @code{aligned_alloc} function allocates a block of @var{size} bytes whose address is a multiple of @var{alignment}. The @var{alignment} must be a -power of two and @var{size} must be a multiple of @var{alignment}. +power of two. The @code{aligned_alloc} function returns a null pointer on error and sets @code{errno} to one of the following values: -- 2.33.0