RFR: 8360515: PROPERFMTARGS should always use size_t template specialization for unit [v2]

Joel Sikström jsikstro at openjdk.org
Wed Jun 25 11:19:47 UTC 2025


> Hello,
> 
> PROPERFMT is defined as the format string "%zu%s", which expects a size_t as input argument. When used in combination with PROPERFMTARGS, which uses the templated byte_size_in_proper_units, the byte size may not be size_t if the input is some other type.
> 
> To minimize confusion, PROPERFMTARGS should always use the size_t template specilization of byte_size_in_proper_units, to match PROPERFMT. Places that use byte_size_in_proper_units with other types can still use it, but should use their own format strings instead of PROPERFMT.
> 
> ProcSmapsSummary::print_on in memMapPrinter_macosx is the only place that uses PROPERFMTARGS with a type that is not size_t. I have changed those places to use the expanded version of the macro, which uses the templated version of byte_size_in_proper_unit instead.
> 
> Testing:
> * Currently running Oracle's tier1-2

Joel Sikström has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'master' into JDK-8360515_properfmtargs
 - 8360515: PROPERFMTARGS should always use size_t template specialization for unit

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25975/files
  - new: https://git.openjdk.org/jdk/pull/25975/files/1e340fab..0d51cb39

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25975&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25975&range=00-01

  Stats: 1778 lines in 93 files changed: 1075 ins; 359 del; 344 mod
  Patch: https://git.openjdk.org/jdk/pull/25975.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25975/head:pull/25975

PR: https://git.openjdk.org/jdk/pull/25975


More information about the hotspot-dev mailing list