Trait mun_memory::gc::GcRuntime [−][src]
An object that can be used to allocate and collect memory.
Required methods
fn alloc(&self, ty: T) -> GcPtr
[src]
Allocates an object of the given type returning a GcPtr
fn ptr_type(&self, obj: GcPtr) -> T
[src]
Returns the type of the specified obj
.
fn root(&self, obj: GcPtr)
[src]
Roots the specified obj
, which keeps it and objects it references alive. Objects marked
as root, must call unroot
before they can be collected. An object can be rooted multiple
times, but you must make sure to call unroot
an equal number of times before the object
can be collected.
fn unroot(&self, obj: GcPtr)
[src]
Unroots the specified obj
, potentially allowing it and objects it references to be
collected. An object can be rooted multiple times, so you must make sure to call unroot
the same number of times as root
was called before the object can be collected.
fn stats(&self) -> Stats
[src]
Returns stats about the current state of the runtime.
Implementors
impl<T, O> GcRuntime<T> for MarkSweep<T, O> where
T: TypeMemory + TypeTrace + Clone,
O: Observer<Event = Event>,
[src]
T: TypeMemory + TypeTrace + Clone,
O: Observer<Event = Event>,