![]() |
|
Message-ID: <6yerhz4eth3eyjnjwiwj2ezam3iirwxpxw6qmj7x2cjyv445ah@jk7e67ccmra5>
Date: Fri, 27 Jun 2025 15:49:56 +0200
From: Alejandro Colomar <alx@...nel.org>
To: Martin Uecker <ma.uecker@...il.com>
Cc: Florian Weimer <fweimer@...hat.com>, libc-alpha@...rceware.org,
bug-gnulib@....org, musl@...ts.openwall.com,
наб <nabijaczleweli@...ijaczleweli.xyz>, Douglas McIlroy <douglas.mcilroy@...tmouth.edu>,
Paul Eggert <eggert@...ucla.edu>, Robert Seacord <rcseacord@...il.com>,
Elliott Hughes <enh@...gle.com>, Bruno Haible <bruno@...sp.org>,
JeanHeyd Meneide <phdofthehouse@...il.com>, Rich Felker <dalias@...c.org>,
Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>, Joseph Myers <josmyers@...hat.com>,
Laurent Bercot <ska-dietlibc@...rnet.org>, Andreas Schwab <schwab@...e.de>, Thorsten Glaser <tg@...bsd.de>,
Eric Blake <eblake@...hat.com>, Vincent Lefevre <vincent@...c17.net>,
Mark Harris <mark.hsj@...il.com>, Collin Funk <collin.funk1@...il.com>,
Wilco Dijkstra <Wilco.Dijkstra@....com>, DJ Delorie <dj@...hat.com>,
Cristian Rodríguez <cristian@...riguez.im>, Siddhesh Poyarekar <siddhesh@...plt.org>,
Sam James <sam@...too.org>, Mark Wielaard <mark@...mp.org>,
"Maciej W. Rozycki" <macro@...hat.com>, Christopher Bazley <chris.bazley.wg14@...il.com>,
eskil@...ession.se, Daniel Krügler <daniel.kruegler@...glemail.com>,
Kees Cook <keescook@...omium.org>, Valdis Klētnieks <valdis.kletnieks@...edu>
Subject: Re: alx-0029r5 - Restore the traditional realloc(3) specification
Hi Martin, Florian,
On Fri, Jun 27, 2025 at 02:54:34PM +0200, Martin Uecker wrote:
> Am Freitag, dem 27.06.2025 um 10:52 +0200 schrieb Florian Weimer:
> > * Alejandro Colomar:
> ...
>
> >
> > From an implementation perspective, we need clarification that the
> > allocation functions (except aligned_alloc) may reduce the alignment of
> > the returned pointer to a power of two greater or equal to the requested
> > size, for allocation sizes that are less than the fundamental alignment.
> > (Some existing implementations already do this today, in violation of
> > the standard.)
>
> There is a general rule for all allocation functions:
>
> "The pointer returned if the allocation succeeds is suitably aligned so
> that it may be assigned to a pointer to any type of object with a fundamental
> alignment requirement and size less than or equal to the size requested."
>
> There is some disagreement whether the "requested size" refers to the
> size argument or the total size. IMHO it is a reasonable interpretation
> that it refers to the size argument, but if implementation would explict
> this this could then break programs that swap arguments (the standard
> has no symmetry, it makes clear which is which)
Okay, I'll tweak the wording to make it clear it's the total size.
That's an easy fix.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es/>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.