RFR: 8272160: Avoid using 32-bit counters in CDS code

Ioi Lam iklam at openjdk.org
Wed Nov 5 16:12:58 UTC 2025


On Tue, 4 Nov 2025 19:08:34 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

> There are a handful of counters in CDS code that are `int` when it would be safer to use size_t. While exploring this I discovered that the `_count` field in DumpTimeKlassSubGraphInfoTable is unused so it is removed and the one use case replaced with a more accurate value. Verified with tier1-5 tests.

src/hotspot/share/cds/aotMetaspace.cpp line 2057:

> 2055:     CountSharedSymbols cl;
> 2056:     SymbolTable::shared_symbols_do(&cl);
> 2057:     tty->print_cr("Number of shared symbols: %ld", cl.total());

"%zu" should be used for size_t

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28139#discussion_r2495206343


More information about the hotspot-runtime-dev mailing list