RFR: 8227054: ServiceThread needs to know about all OopStorage objects
coleen.phillimore at oracle.com
coleen.phillimore at oracle.com
Wed Aug 21 01:41:24 UTC 2019
On 8/20/19 5:10 PM, Kim Barrett wrote:
>> On Aug 20, 2019, at 3:42 PM, coleen.phillimore at oracle.com wrote:
>>
>>
>> The iterator code seems to have taken on a life of it's own, but the runtime changes still look good.
> Thanks.
>
>> Can you put some comment about why is there a singular iterator and what its purpose is? Is there some implicit use I can't find?
>>
>> + // Construct a singular iterator. The only valid operations are
>> + // destruction/copy/assignment.
>> + Iterator() :
>> + _index(singular_index),
>> + _limit(singular_index)
>> + DEBUG_ONLY(COMMA _category(singular)) {}
>> +
>>
> Does this help?
>
> - // Construct a singular iterator. The only valid operations are
> - // destruction/copy/assignment.
> + // Construct a singular iterator, not associated with any of the sets
> + // (strong, weak, or all) of storage objects. The only valid operations
> + // are destruction/copy/assignment.
>
> Singular iterators exist so you can declare a variable and later assign to it.
Add this sentence to the comment and I'm fine. I wanted the comment to
say why it exists.
Thanks,
Coleen
> , for example
>
> Iterator it;
> if (need_strong) {
> it = strong_iterator();
> } else {
> it = weak_iterator();
> }
> … use the iterator …
>
> The C++ standard uses the phrase “iterator with a singular value”; “singular iterator” is
> a common shorthand.
>
More information about the hotspot-dev
mailing list