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

Kim Barrett kbarrett at openjdk.java.net
Fri Jul 30 04:18:29 UTC 2021


On Fri, 30 Jul 2021 01:54:54 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8193559.kbarrett.part1 - Kim's proposed rewrite using newer C++ features.
>
> 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.

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

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



More information about the hotspot-gc-dev mailing list