RFR: 8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable

Kim Barrett kbarrett at openjdk.org
Wed Jul 10 20:09:49 UTC 2024


Please review this change to SimpleCompactHashtable to remove some
-Wzero-as-null-pointer-constant warnings when enabled.

It has some pointer-typed members that were being initialized with 0, and are
now initialized with nullptr.

The constructor was also changed to initialize in the mem-initializer-list
rather than as assignments in the body.

In both the constructor and the reset function, the _base_address member was
added to the initialization/assignment sequence.  It was previously missing,
so was uninitialized by the constructor and left unchanged by reset.  This
appears to have been a "harmless" bug; at least, I couldn't find any way to
use the "unset" value.

Testing: mach5 tier1

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

Commit messages:
 - fix and cleanup SimpleCompactHashtable

Changes: https://git.openjdk.org/jdk/pull/20113/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20113&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336082
  Stats: 11 lines in 1 file changed: 2 ins; 0 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/20113.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20113/head:pull/20113

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


More information about the hotspot-runtime-dev mailing list