<div dir="ltr">Maurizio, Andrew, Paul, Per-Ake, <div>Thanks to all of you for very clear explanations!</div><div><br>Lee.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, May 20, 2025 at 1:47 AM Andrew Haley <<a href="mailto:aph-open@littlepinkcloud.com">aph-open@littlepinkcloud.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">On 5/19/25 16:51, Paul Sandoz wrote:<br>
> Note that will not guarantee stable alignment. The GC can move the <br>
> allocated array.<br>
<br>
Is it even allowed?<br>
<br>
<a href="https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/foreign/MemorySegment.html#segment-alignment" rel="noreferrer" target="_blank">https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/foreign/MemorySegment.html#segment-alignment</a><br>
<br>
"Heap segments can only be accessed using a layout whose alignment is <br>
smaller or equal to the maximum alignment associated with the heap <br>
segment. Attempting to access a heap segment using a layout whose <br>
alignment is greater than the maximum alignment associated with the heap <br>
segment will fail,"<br>
<br>
-- <br>
Andrew Haley  (he/him)<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
<a href="https://keybase.io/andrewhaley" rel="noreferrer" target="_blank">https://keybase.io/andrewhaley</a><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
</blockquote></div>