RFR: 8333578: Fix uses of overaligned types induced by ZCACHE_ALIGNED

Axel Boldt-Christmas aboldtch at openjdk.org
Tue Mar 4 07:54:05 UTC 2025


The only directly heap allocated, constructed object of types that are overaligned because of ZCACHE_ALIGNED is ZCollectedHeap. The other are either in static storage or contained in (and constructed as part of) ZCollectedHeap. So we only need to fix ZCollectedHeap allocation. 

As the CollectedHeap is only ever created once and is never destroyed, we can simply align the allocation and create an unfreeable pointer.

This implementation imposes that `ZCacheLineSize` is a power of two, but we already have this requirement elsewhere (e.g. `ZContendedStorage`).

Testing:
 * tier 1 through tier 5 Oracle supported platforms
 * GHA

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

Commit messages:
 - 8333578: Fix uses of overaligned types induced by ZCACHE_ALIGNED

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

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


More information about the hotspot-gc-dev mailing list