RFR: 8252103: Parallel heap inspection for ParallelScavengeHeap [v6]

Stefan Johansson sjohanss at openjdk.java.net
Thu Oct 29 10:42:43 UTC 2020


On Wed, 28 Oct 2020 15:13:01 GMT, Lin Zang <lzang at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psOldGen.hpp line 170:
>> 
>>> 168:   uint iterable_blocks() {
>>> 169:     return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize;
>>> 170:   }
>> 
>> This causes a build failure on windows:
>> hotspot\share\gc/parallel/psOldGen.hpp(169): error C2220: the following warning is treated as an error
>> hotspot\share\gc/parallel/psOldGen.hpp(169): warning C4267: 'return': conversion from 'size_t' to 'uint', possible loss of data
>> I suggest either changing the return here to `int` and make an explicit cast or `size_t` and then add the cast when used in `claim_and_get_block()`
>
> I made the cast in claim_and_get_block() because I think the itrable_blocks() is not possible to return negative values. and it used in claim_and_get_block() to be a signed int only for helping recoginize survior and eden spaces (the block_index). 
> BTW, I didn't rebase this patch to master for quite a while,  I will try to rebase it. 
> Thanks!

You should not rebase, but **merge** with master, to avoid having to force push.

I agree that adding the cast in `claim_and_get_block()` is better, but you still need to update the return value to be `size_t` here. Otherwise you will still fail with the error seen above.

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

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



More information about the hotspot-gc-dev mailing list