RFR: 8282721: HotSpot Style Guide should allow considered use of C++ thread_local [v2]
Kim Barrett
kbarrett at openjdk.java.net
Tue Mar 8 16:13:10 UTC 2022
On Tue, 8 Mar 2022 05:19:40 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Style guide changes to support JDK-8282469 (PR https://github.com/openjdk/jdk/pull/7719). We no longer prohibit use of C++ `thread_local`, but allow it when there is an essential, and considered, need.
>>
>> This is a modification of the Style Guide, so rough consensus among the HotSpot Group members is required to make this change. Only Group members should vote for approval (via the github PR), though reasoned objections or comments from anyone will be considered. A decision on this proposal will not be made before Friday 18-Mar-2022 at 12h00 UTC.
>>
>> Since we're piggybacking on github PRs here, please use the PR review process to approve (click on Review Changes > Approve), rather than sending a "vote: yes" email reply that would be normal for a CFV.
>
> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>
> Feedback from kbarrett and jrose.
Changes requested by kbarrett (Reviewer).
doc/hotspot-style.md line 468:
> 466: (operator new and related functions). Typically, uses of the global
> 467: operator new are inadvertent and therefore often associated with memory
> 468: leaks. Use of these functions by HotSpot code is disabled for some platforms.
I don't agree with the new sentence about uses of global operator new. "Normal" C++ use of global operator new is no more associated with memory leaks than are the other allocations we do in HotSpot. The rationale for disallowing use of global operator new in HotSpot code (as I understand it) is that we want all of our heap allocations to be trackable via NMT. Any uses of global operator new would bypass that.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7720
More information about the hotspot-dev
mailing list