RFR: 8274400: HotSpot Style Guide should permit use of alignof [v5]
Julian Waters
jwaters at openjdk.org
Mon Jan 23 09:47:09 UTC 2023
On Sun, 22 Jan 2023 21:10:21 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> 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 ten additional commits since the last revision:
>>
>> - Hopefully final change
>> - Merge remote-tracking branch 'upstream/master' into alignof
>> - <type_traits>
>> - Merge remote-tracking branch 'upstream/master' into alignof
>> - Make section more brief
>> - Merge remote-tracking branch 'upstream/master' into alignof
>> - More Descriptive Version
>> - Merge remote-tracking branch 'upstream/master' into alignof
>> - HotSpot Style Guide should permit use of alignof
>
> doc/hotspot-style.md line 578:
>
>> 576: * `#include <cstddef>` to use `std::nullptr_t` and `std::max_align_t`.
>> 577:
>> 578: Certain restrictions apply to the inclusion of `<type_traits>`.
>
> There are no restrictions on the inclusion of <type_traits>. Rather, there are restrictions on the
> use of the declarations provided by <type_traits>.
Will do, thanks
> doc/hotspot-style.md line 580:
>
>> 578: Certain restrictions apply to the inclusion of `<type_traits>`.
>> 579:
>> 580: * The `alignof` operator should always be preferred over `std::alignment_of<>`.
>
> I would really like to avoid "prefer" here. Even though "always preferred" has
> the right meaning, I've always thought that was a clumsy turn of phrase,
> unconditionalizing a conditional. Also "prefer over" read oddly to to me. It
> seems to be a less commonly used American English usage, with "prefer to"
> being more common. (And "prefer to" seems exclusively used in British English,
> with "prefer over" not being a thing in that dialect.)
>
> "Use the `alignof` operator rather than `std::alignment_of`."
Changes have been made, sorry for the hassle
-------------
PR: https://git.openjdk.org/jdk/pull/11761
More information about the hotspot-dev
mailing list