Crate abfall

Crate abfall 

Source
Expand description

Abfall - A concurrent tri-color tracing mark and sweep garbage collector for Rust

This library implements a concurrent garbage collector using the tri-color marking algorithm. It provides automatic memory management with minimal pause times through concurrent collection.

§Features

  • Tri-Color Marking: Objects are marked as white (unreachable), gray (reachable but unscanned), or black (reachable and scanned)
  • Concurrent Collection: Background thread performs collection without stopping application
  • Thread-Safe: Safe to use across multiple threads
  • Manual Control: Option to disable automatic collection and trigger manually

§Example

use abfall::GcContext;
use std::sync::Arc;

// Create a GC context with automatic background collection
let ctx = GcContext::new();

// Allocate objects on the GC heap (returns GcRoot)
let value = ctx.allocate(42);
let text = ctx.allocate("Hello, GC!");

// Access through Deref
assert_eq!(*value, 42);
assert_eq!(*text, "Hello, GC!");

Structs§

GcCell
Cell for storing GC-traceable values with write barrier
GcContext
RAII guard for GC context
GcOptions
GcPtr
Lightweight pointer to a GC-managed object
GcRoot
Rooted pointer to a GC-managed object
Heap
The garbage collected heap
Tracer
A tracer for marking reachable objects

Traits§

Trace
Trait for types that can be traced by the garbage collector