RFR: 8361099: Shenandoah: Improve heap lock contention by using CAS for memory allocation [v5]
Xiaolong Peng
xpeng at openjdk.org
Thu Jan 15 18:43:11 UTC 2026
On Fri, 7 Nov 2025 19:45:46 GMT, Xiaolong Peng <xpeng at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 2204:
>>
>>> 2202: i++;
>>> 2203: }
>>> 2204: return obj;
>>
>> I think obj always equals nullptr at this point. Seems the code would be easier to understand (and would depend less on effective compiler optimization) if we just made that explicit. Can we just say:
>>
>> return nullptr?
>
> Yes, it is always `nullptr`, `return nullptr` will make the code more readable.
Resolving this, the code has been refactored, all allocation related codes are in ShenandoahAllocator
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26171#discussion_r2695539186
More information about the shenandoah-dev
mailing list