RFR: JDK-8282798 java.lang.runtime.Carrier [v5]
Jim Laskey
jlaskey at openjdk.java.net
Fri Mar 11 16:44:40 UTC 2022
On Fri, 11 Mar 2022 15:53:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/runtime/Carrier.java line 380:
>>
>>> 378: }
>>> 379:
>>> 380: return Unsafe.ARRAY_LONG_BASE_OFFSET +
>>
>> Shouldn't you add the offset of the first `int` value in the array to the resulting expression? E.g. I'm assuming we're storing `long`s first and `int`s after? If so, `int` values will be located at an offset from the start of the array.
>
> Ah ok - I see - the constructor method handle binds the correct offset, adding the required constant offset (for all the long values). So my comment it's mostly stylistic.
I'll add commentary.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7744
More information about the core-libs-dev
mailing list