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
boa_cli- Boa’s CLI && REPL implementationboa_ast- Boa’s ECMAScript Abstract Syntax Tree.boa_engine- Boa’s implementation of ECMAScript builtin objects and execution.boa_gc- Boa’s garbage collector.boa_icu_provider- Boa’s ICU4X data provider.boa_interner- Boa’s string interner.boa_macros- Boa’s macros.boa_parser- Boa’s lexer and parser.boa_runtime- Boa’sWebAPIfeatures.boa_string- Boa’s ECMAScript string implementation.tag_ptr- Utility library that enables a pointer to be associated with a tag of typeusize.small_btree- Utility library that adds theSmallBTreeMapdata structure.
Macros§
- custom_
trace - Utility macro to manually implement
Traceon a type. - empty_
trace - Utility macro to define an empty implementation of
Trace.
Structs§
- Ephemeron
- A key-value pair where the value becomes unaccesible when the key is garbage collected.
- Gc
- A garbage-collected pointer type over an immutable value.
- GcBox
- A garbage collected allocation.
- GcErased
- A type erased
Gc<T>pointer type. - GcRef
- A wrapper type for an immutably borrowed value from a
GcCell<T>. - GcRef
Cell - A mutable memory location with dynamically checked borrow rules that can be used inside of a garbage-collected pointer.
- GcRef
Mut - A wrapper type for a mutably borrowed value from a
GcCell<T>. - WeakGc
- A weak reference to a
Gc. - WeakMap
- A map that holds weak references to its keys and is traced by the garbage collector.
Traits§
- Finalize
- Substitute for the
Droptrait for garbage collected types. - Trace
- The Trace trait, which needs to be implemented on garbage-collected objects.
Functions§
- finalizer_
safe - Returns
trueif it is safe for a type to runFinalize::finalize. - force_
collect - Forcefully runs a garbage collection of all unaccessible nodes.