dotty.tools.dotc.util.WeakHashSet
See theWeakHashSet companion object
abstract class WeakHashSet[A <: AnyRef](initialCapacity: Int, loadFactor: Double) extends MutableSet[A]
A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other hard references are associated with them. Its primary use case is as a canonical reference identity holder (aka "hash-consing") via findEntryOrUpdate
This Set implementation cannot hold null. Any attempt to put a null in it will result in a NullPointerException
This set implementation is not in general thread safe without external concurrency control. However it behaves properly when GC concurrently collects elements in this set.
Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes