Struct gluon_vm::gc::Gc [−][src]
pub struct Gc { /* fields omitted */ }
Expand description
A mark and sweep garbage collector.
Implementations
Constructs a new garbage collector
pub unsafe fn alloc_and_collect<R, D>(
&mut self,
roots: R,
def: D
) -> Result<OwnedGcRef<'_, D::Value>> where
R: Trace + CollectScope,
D: DataDef + Trace,
D::Value: Sized + Any,
pub unsafe fn alloc_and_collect<R, D>(
&mut self,
roots: R,
def: D
) -> Result<OwnedGcRef<'_, D::Value>> where
R: Trace + CollectScope,
D: DataDef + Trace,
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 trace all accesible GcPtr
values.
Allocates a new object.
pub fn alloc_owned<D>(&mut self, def: D) -> Result<OwnedGcRef<'_, D::Value>> where
D: DataDef,
D::Value: Sized + Any,
pub fn alloc_ignore_limit<D>(&mut self, def: D) -> GcRef<'_, D::Value> where
D: DataDef,
D::Value: Sized + Any,
Does a mark and sweep collection by walking from roots
. This function is unsafe since
roots need to cover all reachable object.
Marks the GcPtr Returns true if the pointer was already marked
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
fn deserialize_state<__D>(
__seed: &mut DeSeed<'gc>,
__deserializer: __D
) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize_state<__D>(
__seed: &mut DeSeed<'gc>,
__deserializer: __D
) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserializes Self
using seed
and the deserializer
fn serialize_state<__S>(
&self,
__serializer: __S,
__seed: &SeSeed
) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
fn serialize_state<__S>(
&self,
__serializer: __S,
__seed: &SeSeed
) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
Serializes self
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more