RFR: 8337597: Macros should be defined in the global namespace in src/hotspot/share/memory/metaspace

Casper Norrbin duke at openjdk.org
Fri Aug 16 14:57:57 UTC 2024


Hi everyone,

Metaspace currently contains macros that appear to be scoped within the `metaspace` namespace, but in reality, their scope is global. To avoid confusion, these macros should be moved to the global namespace.

Additionally, there are instances where macros are defined within functions for localized use. Moving these macros outside the functions would introduce unnecessary complexity. Instead, I’ve opted to `#undef` these macros immediately after their use, ensuring they remain accessible only within their respective functions.

Thanks!

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

Commit messages:
 - clarified defines in metaspace cpp files

Changes: https://git.openjdk.org/jdk/pull/20610/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20610&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8337597
  Stats: 36 lines in 6 files changed: 20 ins; 11 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/20610.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20610/head:pull/20610

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


More information about the hotspot-runtime-dev mailing list