[−][src]Struct gluon_vm::gc::Gc
A mark and sweep garbage collector.
Implementations
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<OwnedGcRef<'_, D::Value>> where
R: Trace + CollectScope,
D: DataDef + Trace,
D::Value: Sized + Any,
[src]
&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.
pub fn alloc<D>(&mut self, def: D) -> Result<GcRef<'_, D::Value>> where
D: DataDef,
D::Value: Sized + Any,
[src]
D: DataDef,
D::Value: Sized + Any,
Allocates a new object.
pub fn alloc_owned<D>(&mut self, def: D) -> Result<OwnedGcRef<'_, D::Value>> where
D: DataDef,
D::Value: Sized + Any,
[src]
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,
[src]
D: DataDef,
D::Value: Sized + Any,
pub unsafe fn check_collect<R>(&mut self, roots: R) -> bool where
R: Trace + CollectScope,
[src]
R: Trace + CollectScope,
pub unsafe fn collect<R>(&mut self, roots: R) where
R: Trace + CollectScope,
[src]
R: Trace + 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
pub unsafe fn clear(&mut self)
[src]
Trait Implementations
impl Debug for Gc
[src]
impl<'de, 'gc> DeserializeState<'de, DeSeed<'gc>> for Gc
[src]
fn deserialize_state<__D>(
__seed: &mut DeSeed<'gc>,
__deserializer: __D
) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__seed: &mut DeSeed<'gc>,
__deserializer: __D
) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
impl Drop for Gc
[src]
impl SerializeState<SeSeed> for Gc
[src]
fn serialize_state<__S>(
&self,
__serializer: __S,
__seed: &SeSeed
) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S,
__seed: &SeSeed
) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<Id> AsId<Id> for Id where
Id: ?Sized,
[src]
Id: ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'_, T> Captures<'_> for T
[src]
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
[src]
type Remainder = Choices
pub fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastArc for T where
T: Downcast + Send + Sync,
[src]
T: Downcast + Send + Sync,
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<D, T> FromPtr<D> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
[src]
U: LiftFrom<T, I>,
impl<Source> Sculptor<HNil, HNil> for Source
[src]
type Remainder = Source
pub fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,