On Wed, 21 Oct 2020 19:49:03 GMT, Stefan Johansson <[email protected]> wrote:

>> Lin Zang has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR.
>
> src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp line 565:
> 
>> 563:   size_t old_gen_used = 
>> ParallelScavengeHeap::heap()->old_gen()->used_in_bytes();
>> 564:   size_t block_size = 
>> ParallelScavengeHeap::heap()->old_gen()->iterate_block_size();
>> 565:   uint n_blocks_in_old = old_gen_used / block_size + 1;
> 
> Instead of doing this calculation here, what do you think about making 
> `iterate_block_size()` a constant in `PSOldGen` and instead adding a function 
> that returns the number of blocks available, something like:
> `iterable_blocks()`

One additional thing here, the `n_blocks_in_old` calculation will return one 
extra block when old_gen_used is a multiple of block_size. : Here's an 
alternative:
  uint n_blocks_in_old = (old_gen_used + block_size - 1) / block_size;

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

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

Reply via email to