<div dir="ltr">Hello,<br><br>SegmentFactories defines MAX_MALLOC_ALIGN variable and sets it to 16 on LP64 architectures. However, section 7.24.4.1 of the libc spec only says<br><br>> The pointer returned if the allocation succeeds is suitably aligned so that it can be <br>> assigned to a pointer to any type of object with a fundamental alignment<br>> requirement and size less than or equal to the size requested<br><br>(<a href="https://open-std.org/JTC1/SC22/WG14/www/docs/n3467.pdf#page=397">https://open-std.org/JTC1/SC22/WG14/www/docs/n3467.pdf#page=397</a>)<br><br>The largest type defined by the spec seems to be “long double” and there is only “Recommended practice” for it:<br><br>> The long double type should match the ISO/IEC 60559 binary128 format, else<br>> an ISO/IEC 60559 binary64-extended format.<br><br>Do I understand correctly that the currently used value of 16 is relying on existing implementations and that the current implementation might misbehave if a malloc call for a size of 8 bytes returns an 8 bytes aligned address, which is allowed by the spec?<br><br>Also, shouldn’t the name be MIN_MALLOC_ALIGN? <br><br>Thanks,<br>Almaz<br></div>