On Fri, 19 Jun 2026 14:54:56 GMT, Jorn Vernee <[email protected]> wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Improve performance for VTs
>
> src/java.base/share/classes/jdk/internal/foreign/ConfinedSegmentPool.java 
> line 142:
> 
>> 140: 
>> 141:     @ForceInline
>> 142:     private static long acquirePlatform(Thread thread) {
> 
> I suggest adding an assert that `thread` is the current thread, to make it 
> clear that there's no race between the `get`/`set` below
> 
> Suggestion:
> 
>     private static long acquirePlatform(Thread thread) {
>         assert thread == Thread.currentThread();

As this is in the hot path, I've added an assertion that is only active in 
slow/fast debug mode.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31365#discussion_r3451466687

Reply via email to