RFR: 8282721: HotSpot Style Guide should allow considered use of C++ thread_local [v2]
Thomas Stuefe
stuefe at openjdk.java.net
Wed Mar 9 08:11:08 UTC 2022
On Tue, 8 Mar 2022 21:18:02 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> First, it's not exactly a new sentence, just one moved from elsewhere in our code base (from a file that was deleted in the companion PR to this one).
>>
>> Second, it is true; we have seen problems in the (distant) past of exactly the form claimed. The problem is that HotSpot is an irregular user of C++, including via assembly code and tortuous stack frame manipulation (deopt handlers etc.). It's easy to accidentally emit a use of of global `op new` through ten layers of C++ header file, and in HotSpot it's also easy to break the careful matching of constructors to destructors that C++ relies on. The result is a storage leak.
>>
>> Kim, I could see you thinking, also, that this sort of observation doesn't belong in a style guide, and a lot of these nuggets might tend to bloat which obscures the useful parts of the style guide. (An over-long guide is not a useful guide after all.) You might suggest where this rationale information goes, if not here. But I think it fits well enough here. And if it isn't inserted here, or some other new place, it will be lost because of David's file deletion in the other PR related to this one. I don't want it to get lost.
>
> I would also like that sentence to not be lost.
Would this not be something for a footnote or an addendum?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7720
More information about the hotspot-dev
mailing list