RFR: 8319797: Recursive lightweight locking: Runtime implementation [v11]

Coleen Phillimore coleenp at openjdk.org
Fri Jan 19 21:42:51 UTC 2024


On Tue, 14 Nov 2023 07:46:56 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> There is probably more nuance here w.r.t. `offsetof` than I know. 
>> My belief was that reason we did not use `offsetof` is because we use it on non standard layout types, for which is invalid. But the lock stack is a standard layout. 
>> 
>> However,  reading some of issues surrounding `offsetof` (mainly poor compiler support and becoming conditionally supported in C++17) there might be more reasons to avoid it. If that is the case this property would have to be asserted at runtime instead. 
>> 
>> Maybe @kimbarrett has some more insight.
>
> To be clear I was querying the use of `std::is_standard_layout` here.

https://en.cppreference.com/w/cpp/language/classes#Standard-layout_class

TIL. Maybe this should be in our allowed list of features?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16606#discussion_r1459799972


More information about the hotspot-dev mailing list