RFR: 8374350: Convert hotspot gtests to use Atomic<T> [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Fri Jan 2 10:31:56 UTC 2026


On Fri, 2 Jan 2026 10:08:26 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Please review this change to convert HotSpot gtests to use Atomic<T> rather
>> than directly using AtomicAccess.
>> 
>> test_atomicAccess.cpp is, of course, not subject to this conversion.
>> 
>> test_globalCounter.cpp is also not included in this conversion.  The other
>> conversions were straight forward.  This test is less so, and I decided I
>> needed to spend more time studying it, so have left it for followup work.
>> 
>> The conversion of each test is a separate commit, in case that makes it easier
>> to review.
>> 
>> Testing: mach5 tier1
>
> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
> 
>   update copyrights

lgtm.

Just wondering if we should use `GrowableArray` instead of NEW/FREE macros and the placement new operator. Or would you rather have such a change as a separate RFE?

test/hotspot/gtest/gc/g1/test_g1BatchedGangTask.cpp line 60:

> 58:   }
> 59: 
> 60:   Atomic<bool>* _do_work_called_by;

Can we use `GrowableArrayCHeap<Atomic<bool>, MemTag::mtInternal>` instead, and skip the manual destruction (and element construction)?

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

Marked as reviewed by aboldtch (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29001#pullrequestreview-3622854328
PR Review Comment: https://git.openjdk.org/jdk/pull/29001#discussion_r2657457204


More information about the hotspot-dev mailing list