WeakValueHashMap¶
@ExperimentalWeakApi
fun <K, V> WeakValueHashMap(): WeakMap<K, V>
A pure-Kotlin common WeakMap implementation using WeakRef.
The values are weakly held.
Performance characteristics¶
Elements are stored in a HashMap. Internal storage is cleared whenever a key is accessed that has a cleared value. The performance of each operation is therefore the same as a HashMap.
See also¶
SoftValueHashMap: The same data structure, with an underlyingSoftRef.