RFR: 8139457: Array bases are aligned at HeapWord granularity [v12]
Roman Kennke
rkennke at openjdk.org
Thu Jan 19 15:56:55 UTC 2023
On Thu, 19 Jan 2023 13:56:16 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Several fixes
>
> src/hotspot/share/opto/runtime.cpp line 315:
>
>> 313: HeapWord* obj = cast_from_oop<HeapWord*>(result);
>> 314: if (!is_aligned(hs_bytes, HeapWordSize)) {
>> 315: *reinterpret_cast<jint*>(reinterpret_cast<char*>(obj + hs_bytes)) = 0;
>
> This seems be adding a value in bytes to a HeapWord*. Shouldn't it be `reinterpret_cast<char*>(obj) + hs_bytes`?
Duh. Yes, indeed. Fixed in follow-up commit. Thanks!
-------------
PR: https://git.openjdk.org/jdk/pull/11044
More information about the hotspot-dev
mailing list