Struct gluon_vm::gc::Gc [−][src]
pub struct Gc { /* fields omitted */ }
A mark and sweep garbage collector.
Methods
impl Gc
[src]
impl Gc
pub fn new(generation: Generation, memory_limit: usize) -> Gc
[src]
pub fn new(generation: Generation, memory_limit: usize) -> Gc
Constructs a new garbage collector
pub fn allocated_memory(&self) -> usize
[src]
pub fn allocated_memory(&self) -> usize
pub fn set_memory_limit(&mut self, memory_limit: usize)
[src]
pub fn set_memory_limit(&mut self, memory_limit: usize)
pub fn generation(&self) -> Generation
[src]
pub fn generation(&self) -> Generation
pub fn new_child_gc(&self) -> Gc
[src]
pub fn new_child_gc(&self) -> Gc
pub unsafe fn alloc_and_collect<R, D>(
&mut self,
roots: R,
def: D
) -> Result<GcPtr<D::Value>> where
R: Traverseable + CollectScope,
D: DataDef + Traverseable,
D::Value: Sized + Any,
[src]
pub unsafe fn alloc_and_collect<R, D>(
&mut self,
roots: R,
def: D
) -> Result<GcPtr<D::Value>> where
R: Traverseable + CollectScope,
D: DataDef + Traverseable,
D::Value: Sized + Any,
Allocates a new object. If the garbage collector has hit the collection limit a collection will occur.
Unsafe since roots
must be able to traverse all accesible GcPtr
values.
pub fn alloc<D>(&mut self, def: D) -> Result<GcPtr<D::Value>> where
D: DataDef,
D::Value: Sized + Any,
[src]
pub fn alloc<D>(&mut self, def: D) -> Result<GcPtr<D::Value>> where
D: DataDef,
D::Value: Sized + Any,
Allocates a new object.
pub fn alloc_ignore_limit<D>(&mut self, def: D) -> GcPtr<D::Value> where
D: DataDef,
D::Value: Sized + Any,
[src]
pub fn alloc_ignore_limit<D>(&mut self, def: D) -> GcPtr<D::Value> where
D: DataDef,
D::Value: Sized + Any,
pub unsafe fn check_collect<R>(&mut self, roots: R) -> bool where
R: Traverseable + CollectScope,
[src]
pub unsafe fn check_collect<R>(&mut self, roots: R) -> bool where
R: Traverseable + CollectScope,
pub unsafe fn collect<R>(&mut self, roots: R) where
R: Traverseable + CollectScope,
[src]
pub unsafe fn collect<R>(&mut self, roots: R) where
R: Traverseable + CollectScope,
Does a mark and sweep collection by walking from roots
. This function is unsafe since
roots need to cover all reachable object.
pub fn mark<T: ?Sized>(&mut self, value: GcPtr<T>) -> bool
[src]
pub fn mark<T: ?Sized>(&mut self, value: GcPtr<T>) -> bool
Marks the GcPtr Returns true if the pointer was already marked
pub unsafe fn sweep(&mut self)
[src]
pub unsafe fn sweep(&mut self)
Clears out any unmarked pointers and resets marked pointers.
Unsafe as it is up to the caller to make sure that all reachable pointers have been marked