<div dir="ltr">That's exactly what I've meant, thank you!</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, 14 Nov 2025 at 10:51, Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
I think this very topic is being discussed here?<br>
<br>
<a href="https://github.com/openjdk/jdk/pull/28235" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/pull/28235</a><br>
<br>
Cheers<br>
Maurizio<br>
<br>
On 14/11/2025 10:42, Almaz Mingaleev wrote:<br>
> Hello,<br>
><br>
> SegmentFactories defines MAX_MALLOC_ALIGN variable and sets it to 16 <br>
> on LP64 architectures. However, section 7.24.4.1 of the libc spec only <br>
> says<br>
><br>
> > The pointer returned if the allocation succeeds is suitably aligned <br>
> 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" rel="noreferrer" target="_blank">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 <br>
> there is only “Recommended practice” for it:<br>
><br>
> > The long double type should match the ISO/IEC 60559 binary128 <br>
> format, else<br>
> > an ISO/IEC 60559 binary64-extended format.<br>
><br>
> Do I understand correctly that the currently used value of 16 is <br>
> relying on existing implementations and that the current <br>
> implementation might misbehave if a malloc call for a size of 8 bytes <br>
> 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>
</blockquote></div>