On Wed, 13 Nov 2024 08:16:31 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java line 300: >> >>> 298: return true; >>> 299: } >>> 300: } >> >> It looks like the new `PhantomCleanableList.remove()` puts 100% trust in the >> correctness of the PhantomCleanable's `index`. >> >> What would you think of adding some sort of check/assert that >> `list.get(phc.index) == phc` ? > > Right, tracking indexes is the part of the algo. I added asserts in most > important sites, `java/lang` still passes with `-esa`. Please take a look > again. Better - thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22043#discussion_r1841081278