public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] manual: remove an obsolete requirement on aligned_alloc() usage
@ 2021-10-21  9:28 John Scott
  2021-10-21 15:41 ` Alejandro Colomar (man-pages)
  2021-10-25 15:45 ` Martin Sebor
  0 siblings, 2 replies; 6+ messages in thread
From: John Scott @ 2021-10-21  9:28 UTC (permalink / raw)
  To: libc-alpha


[-- Attachment #1.1: Type: text/plain, Size: 35 bytes --]

I'm not subscribed; please CC me.

[-- Attachment #1.2: 0001-manual-remove-an-obsolete-requirement-on-aligned_all.patch --]
[-- Type: text/x-patch, Size: 1579 bytes --]

From 315c821421a2279d77e846bf927b7c4107e32d43 Mon Sep 17 00:00:00 2001
From: John Scott <jscott@posteo.net>
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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-26  2:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  9:28 [PATCH] manual: remove an obsolete requirement on aligned_alloc() usage John Scott
2021-10-21 15:41 ` Alejandro Colomar (man-pages)
2021-10-25 15:45 ` Martin Sebor
2021-10-25 16:03   ` Martin Sebor
2021-10-26  1:50   ` Paul Eggert
2021-10-26  2:34     ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).