RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v4]
David Holmes
dholmes at openjdk.org
Wed Oct 22 04:26:06 UTC 2025
On Tue, 21 Oct 2025 14:54:22 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/share/runtime/atomic.hpp line 84:
>>
>>> 82: // Default construction of an atomic integer or atomic byte initializes the
>>> 83: // value to zero. Default construction of an atomic pointer initializes the
>>> 84: // value to null.
>>
>> Suggestion:
>>
>> // value to nullptr.
>>
>> Optional, and total nit-pick. Reason: we are in C++ and not Java.
>
> We generally use "null" in comments, unless it's part of a code snippet.
Yes the convention is that we can talk generally about the concept of null-ness and of a value being null, and only use `nullptr` when referring to actual code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27539#discussion_r2450390239
More information about the hotspot-dev
mailing list