[][src]Struct cgc::GarbageCollector

pub struct GarbageCollector {
    pub verbose: bool,
    // some fields omitted
}

Fields

verbose: bool

Methods

impl GarbageCollector[src]

pub fn new(heap_size: Option<usize>) -> GarbageCollector[src]

pub fn remove_root(&mut self, val: GC<dyn Trace>)[src]

Remove object from rootset

pub fn add_root(&mut self, val: GC<dyn Trace>)[src]

Add root object to rootset

What is a root object?

  • Static or global variables
  • Some object that may own some other objects

pub fn allocate<T: Trace + Sized + 'static>(&mut self, val: T) -> GC<T>[src]

Allocate value in GC space.

pub fn collect(&mut self)[src]

Collect garbage

Trait Implementations

impl Drop for GarbageCollector[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]