[PATCH 1/3] Document max_align_t
Paul Eggert
eggert@cs.ucla.edu
Tue Feb 10 23:14:18 GMT 2026
On 2/10/26 04:38, Florian Weimer wrote:
> What about POSIX-defined types where object definitions are permitted,
> such as pthread_mutex_t?
POSIX does not require any of those types to have fundamental alignment.
Strictly speaking, portable POSIX code must use aligned_alloc etc. for
those types; it can't blindly use malloc.
Surely this is a defect in POSIX. Lots of code uses malloc for this sort
of thing.
> I think authors of replacement mallocs need to know these rules.
Yes, I plan to work that into the next rev of the patch.
More information about the Libc-alpha
mailing list