RFR: 8351137: ZGC: Improve ZValueStorage alignment support [v6]
Axel Boldt-Christmas
aboldtch at openjdk.org
Fri Oct 24 06:49:20 UTC 2025
> ZValueStorage only align the allocations to the alignment defined by the storage but ignores the alignment of the types. Right now all usages of our different storages all have types which have an alignment less than or equal to the alignment set by its storage.
>
> I wish to improve this so that types with greater alignment than the storage alignment can be used.
>
> The UB caused by using a type larger than the storage alignment is something I have seen materialise as returning bad address (and crashing) on Windows.
>
> As we use `utilities/align.hpp` for our alignment utilities we only support power of two alignment, I added extra asserts here because we use the fact that `lcm(x, y) = max(x, y)` if both are powers of two.
>
> Testing:
> * tier 1 through tier 5 Oracle supported platforms
> * GHA
Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
- Merge tag 'jdk-26+21' into JDK-8351137
Added tag jdk-26+21 for changeset 3e20a939
- Merge tag 'jdk-26+19' into JDK-8351137
Added tag jdk-26+19 for changeset b37a1a33
- Merge tag 'jdk-26+18' into JDK-8351137
Added tag jdk-26+18 for changeset 5251405c
- Merge tag 'jdk-26+17' into JDK-8351137
Added tag jdk-26+17 for changeset 2aafda19
- Merge remote-tracking branch 'upstream_jdk/master' into JDK-8351137
- 8351137: ZGC: Improve ZValueStorage alignment support
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23887/files
- new: https://git.openjdk.org/jdk/pull/23887/files/3855f1e7..f09e28dc
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23887&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23887&range=04-05
Stats: 36081 lines in 862 files changed: 21933 ins; 9676 del; 4472 mod
Patch: https://git.openjdk.org/jdk/pull/23887.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23887/head:pull/23887
PR: https://git.openjdk.org/jdk/pull/23887
More information about the hotspot-gc-dev
mailing list