RFR: 8251158: Implementation of JEP 387: Elastic Metaspace [v9]

Richard Reingruber rrich at openjdk.java.net
Mon Oct 5 12:01:40 UTC 2020


On Mon, 5 Oct 2020 11:52:38 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/memory/metaspace/binList.hpp line 141:
>> 
>>> 139:       assert(_blocks[i2] != NULL, "mask mismatch");
>>> 140:       return i2;
>>> 141:     }
>> 
>> There would be `count_leading_zeros()`.
>> If I'm not mistaken, it is _trailing_ zeros that are counted. So you could use
>> [count_trailing_zeros()](https://github.com/openjdk/jdk/blob/d296708ca66ab15e31a05f963a5e162a3e3f07f9/src/hotspot/share/utilities/count_trailing_zeros.hpp#L31)
>
> Right. I'll just remove the comment.

It's not just the comment. I think you should replace the while-loop with
[count_trailing_zeros()](https://github.com/openjdk/jdk/blob/d296708ca66ab15e31a05f963a5e162a3e3f07f9/src/hotspot/share/utilities/count_trailing_zeros.hpp#L31).

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

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



More information about the hotspot-gc-dev mailing list