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

Kim Barrett kbarrett at openjdk.org
Sat Jan 28 13:30:18 UTC 2023


On Tue, 24 Jan 2023 09:16:53 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> doc/hotspot-style.md line 580:
>> 
>>> 578: Certain restrictions apply to the declarations provided by `<type_traits>`.
>>> 579: 
>>> 580: * The `alignof` operator should be utilized rather than `std::alignment_of<>`.
>> 
>> s/utilized/used/
>> https://scientistseessquirrel.wordpress.com/2019/04/16/for-the-love-of-all-that-is-holy-stop-writing-utilize/
>> :)
>
> And here I was thinking this would sound more professional :P
> 
> Speaking of which, could I include a condensed and shortened version of this part from our discussion above? I've left it out in the meantime but just wanted to ask in case
>> std::alignment_of<> could be used in advanced metaprogramming contexts
> involving higher order metafunctions. We don't do that sort of thing much at
> all in HotSpot. If someone finds a place where std::alignment_of<> might be
> better, we can revisit its status.

I don't think that's needed. We already have a blanket statement regarding
violations: "Failure to follow these guidelines may lead to discussion during
code reviews, if not outright rejection of a change." Anyone attempting to add
such code is presumably capable of defending it.

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

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


More information about the hotspot-dev mailing list