pub struct GcHeap {
pub arena: GcArena,
}Expand description
Garbage collector coordinating mark and sweep phases
Fields§
§arena: GcArenaImplementations§
Source§impl GcHeap
impl GcHeap
pub fn new() -> Self
Sourcepub fn allocate(&mut self, obj: JsObject) -> ObjectId
pub fn allocate(&mut self, obj: JsObject) -> ObjectId
Allocate an object. May trigger GC if threshold exceeded.
Sourcepub fn collect(&mut self, vm: &JsVm)
pub fn collect(&mut self, vm: &JsVm)
Run a full garbage collection cycle using roots from the VM
Sourcepub fn should_collect(&self) -> bool
pub fn should_collect(&self) -> bool
Check if a collection should be triggered