RFR: 8189088: Add intrusive doubly-linked list utility [v3]

Kim Barrett kbarrett at openjdk.org
Sat Oct 7 21:36:07 UTC 2023


On Thu, 5 Oct 2023 10:35:18 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add IntrusiveListEntry::is_attached()
>
> src/hotspot/share/utilities/intrusiveList.hpp line 93:
> 
>> 91:  * argument, a const reference to a removed element.  This function should
>> 92:  * "dispose" of the argument object when called, such as by deleting the
>> 93:  * object.  The result of the call is ignored.
> 
> A lot of this information is more easily seen by reading the code. Saying something like:
> 
>>Operations that remove elements from a list take a disposer function as an argument. A disposer should free up the memory associated with the object.
> 
> Shorter documentation is quicker to read and easier to maintain.

There are other uses for disposers than freeing memory.  @kstefanj  found a nice
one while prototyping a conversion of FreeRegionList (which didn't work until
the recent commit to fix the disposer API).

And again, I don't want to require reading the code to just use it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15896#discussion_r1349576945


More information about the hotspot-dev mailing list