On Mon, 15 Apr 2024 10:16:30 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java >> >> Co-authored-by: Jorn Vernee <jornver...@users.noreply.github.com> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java >> >> Co-authored-by: Jorn Vernee <jornver...@users.noreply.github.com> >> - Update src/java.base/share/classes/java/lang/foreign/MemorySegment.java >> >> Co-authored-by: Maurizio Cimadamore >> <54672762+mcimadam...@users.noreply.github.com> > > test/jdk/java/foreign/TestMemoryAlignment.java line 154: > >> 152: Arena arena = Arena.ofConfined()) { >> 153: var segment =channel.map(FileChannel.MapMode.READ_WRITE, >> 0L, 32L, arena); >> 154: assertTrue(segment.maxByteAlignment() >= Long.BYTES); > > Is this always the case? Smells of platform-dependent... (e.g. think also of > x86) I think the alignment is always the biggest of the directly supported primitive types so maybe we should change to `Integer.BYTES` here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18779#discussion_r1565781128