On Wed, 10 Apr 2024 15:19:31 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>> This PR proposes to add two overloads `MemorySegment::reinterpretate` to >> allow aligned reinterpretation. > > test/jdk/java/foreign/TestSegments.java line 396: > >> 394: AtomicInteger counter = new AtomicInteger(); >> 395: try (Arena arena = Arena.ofConfined()){ >> 396: var segment = >> MemorySegment.ofAddress(41).reinterpret(JAVA_INT); > > i.e. this call (and the one below) should throw an exception. Note - this means that the javadoc of the new methods should also document an IllegalArgumentException. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18717#discussion_r1559656059