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

Kim Barrett kbarrett at openjdk.org
Tue Mar 4 15:33:59 UTC 2025


On Tue, 4 Mar 2025 07:49:23 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> 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

Looks good.

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

Marked as reviewed by kbarrett (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23885#pullrequestreview-2658015606


More information about the hotspot-gc-dev mailing list