On Wed, 14 Jun 2023 22:28:38 GMT, Jorn Vernee <[email protected]> wrote:
>> Add missing alignment checks for the alignment constraint of the root layout
>> of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle
>> `MemoryLayout::sliceHandle`.
>>
>> Testing: `jdk_foreign` test suite
>
> Jorn Vernee has updated the pull request incrementally with one additional
> commit since the last revision:
>
> formatting
Marked as reviewed by mcimadamore (Reviewer).
src/java.base/share/classes/jdk/internal/foreign/LayoutPath.java line 200:
> 198:
> 199: VarHandle handle = Utils.makeSegmentViewVarHandle(valueLayout);
> 200: handle = MethodHandles.collectCoordinates(handle, 1,
> offsetHandle());
nice simplification!
test/jdk/java/foreign/TestLayoutPaths.java line 152:
> 150: String expectedMessage = "Target offset incompatible with
> alignment constraints: " + struct.byteAlignment();
> 151:
> 152: try {
Can assertThrows be used to simplify this pattern?
-------------
PR Review: https://git.openjdk.org/jdk/pull/14475#pullrequestreview-1480416811
PR Review Comment: https://git.openjdk.org/jdk/pull/14475#discussion_r1230245077
PR Review Comment: https://git.openjdk.org/jdk/pull/14475#discussion_r1230246478