Registry / utility / gc-arena

gc-arena

JSON →
library0.6.0rscratesunverified

Safe, incrementally garbage collected arenas for Rust.

# Cargo.toml [dependencies] gc-arena = "0.6.0"
INSTALL
IMPORT
SIG · GC-ARENA
G
gc-arena
utilityrustv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Arena
use gc_arena::Arena;

Creating a garbage-collected linked list node.

use gc_arena::{Arena, Collect, Gc}; #[derive(Collect)] #[collect(no_drop)] struct Node { value: i32, next: Option<Gc<Node>>, } fn main() { let arena = Arena::new(|mc| { let node = Gc::allocate(mc, Node { value: 42, next: None }); node }); println!("{}", arena.root().value); }
Debug
Known issues
gotchaTypes must implement the `Collect` trait and cannot have custom drop logic.
fix
Derive `Collect` and add `#[collect(no_drop)]` if the type doesn't need drop.
affects: >=0.6.0
Upgrade
Version history
0.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
gc-arena — cargo add gc-arena · libregistry