Expand description
Thread-safe shared garbage collection.
Most users of this module will be interested in using Gc directly out of the box - this will
just work.
Those with more particular needs (such as benchmarking) should turn toward
set_collect_condition in order to tune exactly when the garbage collector does cleanups.
§Examples
use dumpster::sync::Gc;
let my_gc = Gc::new(100);
let other_gc = my_gc.clone();
drop(my_gc);
drop(other_gc);
// contents of the Gc are automatically freedMacros§
Structs§
- Collect
Info - Information passed to a
CollectConditionused to determine whether the garbage collector should start collecting. - Gc
- A thread-safe garbage-collected pointer.
Functions§
- collect
- Begin a collection operation of the allocations on the heap.
- default_
collect_ condition - The default collection condition used by the garbage collector.
- set_
collect_ condition - Set the function which determines whether the garbage collector should be run.
Type Aliases§
- Collect
Condition - A function which determines whether the garbage collector should start collecting.
This type primarily exists so that it can be used with
set_collect_condition.