Module gc

Source
Expand description

Garbage-Collected smart pointers with interior mutability.

Gc is conceptually similar to Arc<tokio::sync::RwLock>, but garbage collection occurs concurrently at a fixed cadence or whenever a threshold of memory has been allocated as opposed to when the type is Dropped.

Strictly speaking, Gc is not garbage collection per-se but instead uses “cycle collection”.

Cycle collection was chosen because it has similar characteristics to Gc, providing all of the semantics Scheme expects and also plays nicely as a Rust type (no need to root/unroot).

Structs§

Gc
A Garbage-Collected smart pointer with interior mutability.
GcHeader
GcInner
GcReadGuard
GcWriteGuard

Traits§

Trace
Safety

Functions§

init_gc
process_mutation_buffer
SAFETY: this function is not reentrant, may only be called by once per epoch, and must complete before the next epoch.

Type Aliases§

OpaqueGcPtr

Derive Macros§

Trace