RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Jun 14 23:19:55 UTC 2023


On Wed, 14 Jun 2023 22:28:38 GMT, Jorn Vernee <jvernee at openjdk.org> 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

src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 383:

> 381:      * {@code 0 <= x_i < b_i}, where {@code 1 <= i <= n}, or {@link IndexOutOfBoundsException} is thrown.
> 382:      * <p>
> 383:      * The accessed address must be <a href="MemorySegment.html#segment-alignment">aligned</a> according to the {@linkplain

Very nice and clear!

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14475#discussion_r1230261542


More information about the core-libs-dev mailing list