Skip to main content

Crate gomi

Crate gomi 

Source
Expand description

codeberg.org crates.io docs.rs

gomi is a drop-in conservative garbage collection library for Rust.
Its goal is to seamlessly integrate into the language, without requiring any additional boilerplate* or precautions**.

Allocating values using new yields so-called “managed references”. Whether a reference is managed or not is completely opaque to the application and as such it can be used like any regular reference.
While managed references can be used pervasively, they’re intended to be used only when needed. Avoid using managed references where regular references, Rc or Box would be equally usable.

* gomi::Allocator needs to be set as the global allocator.
** see the Safety section for new for additional details.

Structs§

Allocator
GCStatistics
A set of useful information about the last garbage collection cycle.

Functions§

force_collection
Forces a stop-the-world collection to take place.
live_objects_count
Gets how many allocations are currently present on the managed heap.
new
Allocates the provided value on the managed heap.
The resulting reference is effectively valid for the entire duration of the program, as far as Rust is concerned, since any reference to it will keep it alive. We shall refer to it and any interior reference to the value as a “managed reference”.
statistics
See GCStatistics for more info.