RFR: 8337031: Improvements to CompilationMemoryStatistic

Thomas Stuefe stuefe at openjdk.org
Sat Jul 27 05:41:36 UTC 2024


On Fri, 26 Jul 2024 18:18:45 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

>> src/hotspot/share/compiler/compilationMemoryStatistic.cpp line 204:
>> 
>>> 202:   size_t _total;
>>> 203:   // usage per arena tag when total peaked
>>> 204:   size_t _tags_size_at_peak[Arena::tag_count()];
>> 
>> Can you please make sure Arena::tag_count() evaluates to constexpr? When in doubt, just use the enum value instead.
>
> Arena::tag_count() is declared as a constexpr. I wanted to avoid writing `static_cast<int>(Arena::Tag::tag_count)` every time I need tag_count, so I wrapped it in Arena::tag_count() and declared it with constexpr. Is that not sufficient to make it a constexpr?

Okay then, that is fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20304#discussion_r1693848291


More information about the hotspot-compiler-dev mailing list