RFR: 8310311: Serial: move Generation::contribute_scratch to DefNewGeneration [v2]

Kim Barrett kbarrett at openjdk.org
Mon Jul 31 13:20:47 UTC 2023


On Mon, 31 Jul 2023 09:45:57 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/serial/defNewGeneration.cpp line 989:
>> 
>>> 987:   }
>>> 988: 
>>> 989:   constexpr static size_t MinFreeScratchWords = 100;
>> 
>> Is there a reason this needs to be a `constexpr static` when a simple `const` seems to be sufficient?
>
> Dropped `static`. `constexpr` makes it more a num literal. (The generated release asm is identical anyway.)

I think constexpr doesn't do anything here beyond what const would do. I'm not sure about this, but
I think I'd prefer to reserve the use of constexpr only where it (might) matter.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14540#discussion_r1279280912


More information about the hotspot-gc-dev mailing list