[PATCH] libio: Add small optimization on fmemopen

Florian Weimer fweimer@redhat.com
Fri Sep 23 05:34:00 GMT 2016


On 09/23/2016 07:17 AM, Ondřej Bílka wrote:
>>   size_t clen = sizeof (fmemopen_cookie_t);
>>   if (FLEXMEMBER_NEEDS_ALIGNMENT)
>>     clen += _Alignof (fmemopen_cookie_t) - 1;
>
> Couldn't you just use __attribute__((aligned(16))) or is that also
> buggy?

Buggy in what sense?

malloc isn't guaranteed to provide 16-byte alignment on all glibc 
architectures.

Florian



More information about the Libc-alpha mailing list