Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361427

(ref) Merge CleanableList copies

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      jdk.internal.ref.CleanerImpl.CleanableList is a specialized set for tracking phantom cleanables. java.nio.BufferCleaner.CleanerList is a copy-paste-modify version of that CleanableList class. It would be nice to merge them.

      As part of that, the name of the sun.io.Cleaner interface used by java.nio.BufferCleaner might be reconsidered, or even replaced by java.lang.ref.Cleaner.Cleanable.

      There is another "cleaner" with its own set for tracking phantom cleanables: java.desktop/share/classes/sun/java2d/Disposer.java. It uses a hashtable to provide the mapping from Reference objects to associated Runnable cleanup action. Experimenting with BufferCleaner found that the CleanerList approach had better performance than a hashtable-based approach. So perhaps change this one too.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: