RFR: 8326763: Consolidate print methods in ContiguousSpace

Guoxiong Li gli at openjdk.org
Wed Feb 28 15:12:14 UTC 2024


On Wed, 28 Feb 2024 15:07:10 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/space.cpp line 105:
>> 
>>> 103: 
>>> 104: void ContiguousSpace::print_on(outputStream* st) const {
>>> 105:   st->print_cr(" space %zuK, %3d%% used [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
>> 
>> Why not use the previous `SIZE_FORMAT`?
>
> `%zu` is shorter and easier to read, and it's widely used in new code; `SIZE_FORMAT` is used in old code when we didn't have `%zu`.

Got it. Thanks for your explanation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18022#discussion_r1506119494


More information about the hotspot-gc-dev mailing list