Skip to main content

Crate gc_arena

Crate gc_arena 

Source

Re-exports§

pub use self::arena::Arena;
pub use self::arena::Rootable;
pub use self::collect::Collect;
pub use self::dynamic_roots::DynamicRoot;
pub use self::dynamic_roots::DynamicRootSet;
pub use self::lock::GcLock;
pub use self::lock::GcRefLock;
pub use self::lock::Lock;
pub use self::lock::RefLock;

Modules§

arena
barrier
Write barrier management.
collect
dynamic_roots
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.
unsize
Unsizes a Gc or GcWeak pointer.

Structs§

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
Mutation
Handle value given by arena callbacks during construction and mutation. Allows allocating new Gc pointers and internally mutating values held by Gc pointers.
Static
A wrapper type that implements Collect whenever the contained T is ’static, which is useful in generic contexts

Derive Macros§

Collect
Derives the Collect trait needed to trace a gc type.