RFR: JDK-8304820: Statically allocate ObjectSynchronizer mutexes [v4]

David Holmes dholmes at openjdk.org
Wed Mar 29 02:44:34 UTC 2023


On Tue, 28 Mar 2023 13:29:01 GMT, Justin King <jcking at openjdk.org> wrote:

>> Similar to https://git.openjdk.org/jdk/pull/13143, statically allocate mutexes which live for the lifetime of the process.
>
> Justin King has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove unnecessary align_up
>   
>   Signed-off-by: Justin King <jcking at google.com>

src/hotspot/share/runtime/synchronizer.cpp line 253:

> 251: 
> 252: // Static storage for an array of PlatformMutex.
> 253: alignas(PlatformMutex) static uint8_t _inflation_locks[inflation_lock_count()][sizeof(PlatformMutex)];

Sorry I am still not understanding why this can't just be:

alignas(PlatformMutex) static PlatformMutex _inflation_locks[inflation_lock_count()];

??? (And is the alignas even needed?)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13160#discussion_r1151334769


More information about the hotspot-runtime-dev mailing list