RFR: 8274400: HotSpot Style Guide should permit use of alignof [v2]

Justin King jcking at openjdk.org
Tue Dec 27 08:41:49 UTC 2022


On Mon, 26 Dec 2022 16:13:20 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> The alignof operator was added by C++11. It returns the alignment for the given type. Various metaprogramming usages exist, in particular when using std::aligned_storage. Use of this operator should be permitted in HotSpot code.
>
> Julian Waters 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 three additional commits since the last revision:
> 
>  - More Descriptive Version
>  - Merge remote-tracking branch 'upstream/master' into alignof
>  - HotSpot Style Guide should permit use of alignof

FYI `std::aligned_storage` and `std::aligned_union` are deprecated in C++23 and will eventually be removed in future versions.

So shifting toward `alignas` and `alignof` makes the most sense, as proposed.

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

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


More information about the hotspot-dev mailing list