Skip to content

opensavvy.pedestal.weak

Primitive weak data structures and their default (platform-specific) implementation.

Types

ExperimentalWeakApi

@RequiresOptIn(message = "This API is waiting for feedback before stabilization. Please send us feedback at https://gitlab.com/opensavvy/groundwork/pedestal/-/issues/150", level = RequiresOptIn.Level.ERROR)
annotation class ExperimentalWeakApi

WeakMap

interface WeakMap<in K, V>

A weak map is a map in which elements can be garbage-collected at any moment.

WeakRef

interface WeakRef<out T>

A weak reference holds a reference to another object, without preventing that object from being garbage-collected.

Functions

SoftRef

@ExperimentalNativeApi
expect fun <TTTTT> SoftRef(value: T): WeakRef<T>

@ExperimentalNativeApi
actual fun <TTTTT> SoftRef(value: T): WeakRef<T>

@ExperimentalNativeApi
actual fun <TTTTT> SoftRef(value: T): WeakRef<T>

@ExperimentalNativeApi
actual fun <TTTTT> SoftRef(value: T): WeakRef<T>
@ExperimentalNativeApi
actual fun <TTTTT> SoftRef(value: T): WeakRef<T>

Instantiates a soft reference: a reference to a value that doesn't stop the garbage collector from collecting it.

Implementation of WeakRef backed by a JS WeakRef.

Implementation of WeakRef backed by a JVM SoftReference.

Implementation of WeakRef backed by a native WeakReference.

Implementation of WeakRef backed by a JS WeakRef.