RFR: 8250269: Replace ATTRIBUTE_ALIGNED with alignas [v17]
Kim Barrett
kbarrett at openjdk.org
Tue Aug 22 06:10:32 UTC 2023
On Fri, 23 Jun 2023 02:31:11 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> C++11 added the alignas attribute, for the purpose of specifying alignment on types, much like compiler specific syntax such as gcc's __attribute__((aligned(x))) or Visual C++'s __declspec(align(x)).
>>
>> We can phase out the use of the macro in favor of the standard attribute. In the meantime, we can replace the compiler specific definitions of ATTRIBUTE_ALIGNED with a portable definition. We might deprecate the use of the macro but changing its implementation quickly and cleanly applies the feature where the macro is being used.
>>
>> Note: With certain parts of HotSpot using ATTRIBUTE_ALIGNED so indiscriminately, this commit will likely take some time to get right
>>
>> This will require adding the alignas attribute to the list of language features approved for use in HotSpot code. (Completed with [8297912](https://github.com/openjdk/jdk/pull/11446))
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits:
>
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - alignas
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - Merge branch 'openjdk:master' into alignas
> - ... and 7 more: https://git.openjdk.org/jdk/compare/5a82fa3b...bb9ae391
I think some of the uses of ZCACHE_ALIGNED might be wrong, but I don't think they are
made any worse by this change. So looks good.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/11431#pullrequestreview-1588430390
More information about the hotspot-dev
mailing list