[][src]Struct gluon_vm::gc::Gc

pub struct Gc { /* fields omitted */ }

A mark and sweep garbage collector.

Methods

impl Gc[src]

pub fn new(generation: Generation, memory_limit: usize) -> Gc[src]

Constructs a new garbage collector

pub fn allocated_memory(&self) -> usize[src]

pub fn set_memory_limit(&mut self, memory_limit: usize)[src]

pub fn generation(&self) -> Generation[src]

pub fn new_child_gc(&self) -> Gc[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
[src]

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]

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 unsafe fn check_collect<R>(&mut self, roots: R) -> bool where
    R: Traverseable + CollectScope
[src]

pub unsafe fn collect<R>(&mut self, roots: R) where
    R: Traverseable + CollectScope
[src]

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]

Marks the GcPtr Returns true if the pointer was already marked

pub unsafe fn sweep(&mut self)[src]

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

Trait Implementations

impl Debug for Gc[src]

Auto Trait Implementations

impl Send for Gc

impl !Sync for Gc

Blanket Implementations

impl<D, T> FromPtr for T[src]

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<Choices> CoproductSubsetter for Choices[src]

type Remainder = Choices

impl<Source> Sculptor for Source[src]

type Remainder = Source

impl<T, U, I> LiftInto for T where
    U: LiftFrom<T, I>, 
[src]

impl<T> Any for T where
    T: Any
[src]