WeakMap

Instantiates a new, empty WeakMap.

The map returned by this function has weak keys: keys of the map may be freed if they are not referred to elsewhere in the program. When a key is freed, its value is freed as well.

Values are strongly held: until a key is removed from the map, it may never be freed by the garbage-collector.

The way the map decides whether two keys are identical is implementation-defined. For example, some implementations may use referential equality, some others may use the Any.equals function.


expect fun <K, V> WeakMap(values: Map<K, V>): WeakMap<K, V>(source)

Instantiates a new WeakMap by copying values.

The map returned by this function has weak keys: keys of the map may be freed if they are not referred to elsewhere in the program. When a key is freed, its value is freed as well.

Values are strongly held: until a key is removed from the map, it may never be freed by the garbage-collector.

The way the map decides whether two keys are identical is implementation-defined. For example, some implementations may use referential equality, some others may use the Any.equals function.

Instantiates a new, empty WeakMap.

This implementation is backed by a JS WeakMap.


actual fun <K, V> WeakMap(values: Map<K, V>): WeakMap<K, V>(source)

Instantiates a new WeakMap by copying values.

This implementation is backed by a JS WeakMap.

Instantiates a new, empty WeakMap.

This implementation is backed by a Java WeakHashMap.


actual fun <K, V> WeakMap(values: Map<K, V>): WeakMap<K, V>(source)

Instantiates a new WeakMap by copying values.

This implementation is backed by a Java WeakHashMap.

Instantiates a new, empty WeakMap.

This implementation uses WeakKeyArrayMap.


actual fun <K, V> WeakMap(values: Map<K, V>): WeakMap<K, V>(source)

Instantiates a new WeakMap by copying values.

This implementation uses WeakKeyArrayMap.

Instantiates a new, empty WeakMap.

This implementation uses WeakKeyArrayMap.


actual fun <K, V> WeakMap(values: Map<K, V>): WeakMap<K, V>(source)

Instantiates a new WeakMap by copying values.

This implementation uses WeakKeyArrayMap.