RFR: 8275381 G1: refactor 2 constructors of G1CardSetConfiguration
Hamlin Li
mli at openjdk.java.net
Thu Oct 21 02:06:00 UTC 2021
On Wed, 20 Oct 2021 15:26:59 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> Instead of introducing a `init` method, I think [delegating constructor](https://en.cppreference.com/w/cpp/language/constructor) is designed for this use case.
Thanks for discussing for this, I thought so at first, but I finally choose to use init instead, the reason in my mind is that
_num_buckets_in_howl = G1CardSetHowl::num_buckets(_max_cards_in_card_set, _num_cards_in_array, max_buckets_in_howl);
is specifically what's intended by G1CardSetConfiguration(/*with arguments*/), but
_num_buckets_in_howl = G1RemSetHowlNumBuckets;
is what's intended by G1CardSetConfiguration().
So I think it's better to use another method init(...), rather than mix the logic of G1CardSetConfiguration() into G1CardSetConfiguration(/*with arguments*/).
How do you think about it?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6033
More information about the hotspot-gc-dev
mailing list