[−][src]Struct gluon_vm::gc::Gc
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]
&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]
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]
D: DataDef,
D::Value: Sized + Any,
pub unsafe fn check_collect<R>(&mut self, roots: R) -> bool where
R: Traverseable + CollectScope,
[src]
R: Traverseable + CollectScope,
pub unsafe fn collect<R>(&mut self, roots: R) where
R: Traverseable + CollectScope,
[src]
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]
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
Auto Trait Implementations
Blanket Implementations
impl<D, T> FromPtr for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Choices> CoproductSubsetter for Choices
[src]
type Remainder = Choices
fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<Source> Sculptor for Source
[src]
impl<T, U, I> LiftInto for T where
U: LiftFrom<T, I>,
[src]
U: LiftFrom<T, I>,
impl<T> Any for T where
T: Any,
[src]
T: Any,