On Wed, 13 Nov 2024 00:30:37 GMT, Brent Christian <bchri...@openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Touchups: assert index, polish commits > > 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22043#discussion_r1839714073