![]() |
|
Message-ID: <4597a104d793c3c166151779ba30857e2e15c23e.camel@gmail.com> Date: Fri, 27 Jun 2025 14:54:34 +0200 From: Martin Uecker <ma.uecker@...il.com> To: Florian Weimer <fweimer@...hat.com>, Alejandro Colomar <alx@...nel.org> Cc: 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 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) Martin
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.