RFR: JDK-8282798 java.lang.runtime.Carrier [v4]

Jim Laskey jlaskey at openjdk.java.net
Thu Mar 10 22:56:46 UTC 2022


On Thu, 10 Mar 2022 22:29:48 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Leave public for the time being
>
> src/java.base/share/classes/java/lang/runtime/Carrier.java line 346:
> 
>> 344:              * Carrier for longs and integers.
>> 345:              */
>> 346:             private final int[] integers;
> 
> I believe (@rose00 correct me if I'm wrong) that an `int[]` doesn't guarantee proper 64-but alignment of the first element in the array in 32-bit platforms. We ran into similar issues with the MemorySegment API, I believe. I think using a `long[]` if you want explicit 64-bit alignment is the safest choice.

Makes sense. Easy change.

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

PR: https://git.openjdk.java.net/jdk/pull/7744


More information about the core-libs-dev mailing list