RFR: 8319242: HotSpot Style Guide should discourage non-local variables with non-trivial initialization or destruction

Kim Barrett kbarrett at openjdk.org
Mon Jun 16 08:27:29 UTC 2025


On Mon, 16 Jun 2025 07:58:27 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Please review this change to the HotSpot Style Guide to add discussion of how
>> we prefer to handle initialization and destruction of non-local variables.
>> 
>> I propose this is an editorial change, as it just documents current practice
>> rather than suggesting a change to current practice. As such, the normal
>> HotSpot PR process applies.
>> 
>> The updated .html file was generated using make update-build-docs.
>
> doc/hotspot-style.md line 777:
> 
>> 775: Avoid variables with static storage duration and non-constant initialization,
>> 776: or with non-trivial destruction.  Such variables can lead to the so-called
>> 777: "static initialization order fiasco", or its dual on the destruction size.
> 
> What does `destruction size` mean here? Or did you intend to write "destruction site"?

Oops, I meant s/site/side/.  Will fix.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25812#discussion_r2149339481


More information about the hotspot-dev mailing list