Crate boa_gc

source ·
Expand description

Boa’s boa_gc crate implements a garbage collector.

Crate Overview

boa_gc is a mark-sweep garbage collector that implements a Trace and Finalize trait for garbage collected values.

About Boa

Boa is an open-source, experimental ECMAScript Engine written in Rust for lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some of the language. More information can be viewed at Boa’s website.

Try out the most recent release with Boa’s live demo playground.

Boa Crates


  • pub use crate::trace::Tracer;


  • cell 🔒
    A garbage collected cell implementation
  • internals 🔒
  • pointers 🔒
    Pointers represents the External types returned by the Boa Garbage Collector
  • trace 🔒



  • Allocator 🔒
    The Allocator handles allocation of garbage collected values.
  • BoaGc 🔒
  • Collector 🔒
    This collector currently functions in four main phases
  • DropGuard 🔒
    DropGuard flags whether the Collector is currently running Collector::sweep() or Collector::dump()
  • A key-value pair where the value becomes unaccesible when the key is garbage collected.
  • A garbage-collected pointer type over an immutable value.
  • A garbage collected allocation.
  • GcConfig 🔒
  • A wrapper type for an immutably borrowed value from a GcCell<T>.
  • A mutable memory location with dynamically checked borrow rules that can be used inside of a garbage-collected pointer.
  • A wrapper type for a mutably borrowed value from a GcCell<T>.
  • A weak reference to a Gc.
  • A map that holds weak references to its keys and is traced by the garbage collector.



  • Substitute for the Drop trait for garbage collected types.
  • The Trace trait, which needs to be implemented on garbage-collected objects.


Type Aliases

Derive Macros