RFR: 8306444: Don't leak memory in PhaseChaitin::PhaseChaitin [v2]
Johan Sjölen
jsjolen at openjdk.org
Thu Apr 20 12:38:34 UTC 2023
On Wed, 19 Apr 2023 17:51:09 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Apply Kozlov's comments
>
> src/hotspot/share/opto/chaitin.cpp line 263:
>
>> 261: ::memmove(offset, buckets[i], buckcnt[i]*sizeof(Block*));
>> 262: offset += buckcnt[i];
>> 263: }
>
> May add assert that `assert((offset - &buckets[0][0]) == nr_blocks`
I added `assert((&buckets[0][0] + nr_blocks) == offset, "should be");`, it's easier for me to see that `nr_blocks` is implicitly multiplied with `sizeof(Block*)` :-).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13533#discussion_r1172521966
More information about the hotspot-compiler-dev
mailing list