On Thu, 5 Aug 2021 04:00:25 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:

>> The _tlist is used locally in JfrJavaThreadIteratorAdapter constructor only, 
>> so it is possible to get rid of it for the price of complicating the 
>> constructor a little bit.
>
> The `_tlist` is a handle that ensures the captured ThreadsList remains live 
> while the iterator (or a copy) exists.  Dropping it would leave `_it` and 
> `_end` potentially dangling.

Okay I had assumed there was a ThreadsList/Handle in the enclosing scope that 
was being used to initialize this and keep things live, but that is not the 
case.
I still think it makes no sense to have a StackObj subtype as a member though. 
Maybe ThreadsListHandle should no longer be a StackObj ?

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

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

Reply via email to