[PATCH v2] Implement C23 memalignment

Florian Weimer fweimer@redhat.com
Mon Oct 13 14:27:55 GMT 2025


* Joseph Myers:

> On Fri, 10 Oct 2025, Florian Weimer wrote:
>
>> * Joseph Myers:
>> 
>> > Add the C23 memalignment function (query the alignment of a pointer)
>> > to glibc.
>> >
>> > Given how simple this operation is, it would make sense for compilers
>> > to inline calls to this function, but I'm treating that as a compiler
>> > matter (compilers should add it as a built-in function) rather than
>> > adding an inline version to glibc headers (although such an inline
>> > version would be reasonable as well).  I've filed
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122117 for this feature
>> > in GCC.
>> 
>> Should this function be added to libc_nonshared.a until the standard is
>> released, in case its definition changes in subsequent drafts?
>
> This function is from C23, not C2y.

Oh okay, so that part of my response is clearly wrong.

What about my suggestion regarding the performance advice in the manual?

Thanks,
Florian



More information about the Libc-alpha mailing list