RFR: 8193559: ugly DO_JAVA_THREADS macro should be replaced [v4]

David Holmes dholmes at openjdk.java.net
Fri Jul 30 05:52:29 UTC 2021


On Fri, 30 Jul 2021 04:15:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/runtime/threadSMR.cpp line 638:
>> 
>>> 636: 
>>> 637: uint ThreadsList::Iterator::check_index(ThreadsList* list, uint i) {
>>> 638:   assert(i <= list->length(), "invalid index %u", i);
>> 
>> Shouldn't that just be a '<' check?
>
> No, less-eq is correct.  The index being checked here can be 1-past-the-last-element, for an end-iterator.  Including 0 for an empty sequence.

Okay - thanks for explaining.

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

PR: https://git.openjdk.java.net/jdk/pull/4671


More information about the hotspot-gc-dev mailing list