Crate gc_arena

Source

Re-exports§

pub use self::arena::rootless_arena;
pub use self::arena::Arena;
pub use self::arena::CollectionPhase;
pub use self::arena::Root;
pub use self::arena::Rootable;

Modules§

arena
barrier
Write barrier management.
lock
GC-aware interior mutability types.
metrics

Macros§

Rootable
A convenience macro for quickly creating a type that implements Rootable.
static_collect
If a type is static, we know that it can never hold Gc pointers, so it is safe to provide a simple empty Collect implementation.
unsafe_empty_collect
If a type will never hold Gc pointers, you can use this macro to provide a simple empty Collect implementation.
unsize
Unsizes a Gc or GcWeak pointer.

Structs§

Collection
Handle value given by arena callbacks during garbage collection, which must be passed through Collect::trace implementations.
DynamicRoot
An unbranded, reference-counted handle to a GC root held in some DynamicRootSet.
DynamicRootSet
A way of registering GC roots dynamically.
Finalization
Handle value given to finalization callbacks in MarkedArena.
Gc
A garbage collected pointer to a type T. Implements Copy, and is implemented as a plain machine pointer. You can only allocate Gc pointers through a &Mutation<'gc> inside an arena type, and through “generativity” such Gc pointers may not escape the arena they were born in or be stored inside TLS. This, combined with correct Collect implementations, means that Gc pointers will never be dangling and are always safe to access.
GcWeak
MismatchedRootSet
Error returned when trying to fetch a DynamicRoot from the wrong DynamicRootSet.
Mutation
Handle value given by arena callbacks during construction and mutation. Allows allocating new Gc pointers and internally mutating values held by Gc pointers.
StaticCollect
A wrapper type that implements Collect whenever the contained T is ’static, which is useful in generic contexts

Traits§

Collect
A trait for garbage collected objects that can be placed into Gc pointers. This trait is unsafe, because Gc pointers inside an Arena are assumed never to be dangling, and in order to ensure this certain rules must be followed: