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

David Holmes dholmes at openjdk.org
Tue Jun 17 03:33:34 UTC 2025


On Mon, 16 Jun 2025 12:04:12 GMT, Kim Barrett <kbarrett 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.
>
> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
> 
>   better terminology, merge separate sections

doc/hotspot-style.md line 778:

> 776: [C++14 3.6.2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
> 777: should be avoided, unless an implementation is permitted to perform the
> 778: initialization as a static initialization. The order in which dynamic

What does "an implementation" refer to here? The C++ compiler? If so how could we permit this unless all supported "implementations" are guaranteed to permit it?

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

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


More information about the hotspot-dev mailing list