RFR: 8326763: Consolidate print methods in ContiguousSpace

Albert Mingkun Yang ayang at openjdk.org
Wed Feb 28 15:12:14 UTC 2024


On Wed, 28 Feb 2024 15:00:47 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Trivial inlining and removing some unused methods.
>
> 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`.

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

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


More information about the hotspot-gc-dev mailing list