Struct Mutation

Source
pub struct Mutation<'gc> { /* private fields */ }
Expand description

Handle value given by arena callbacks during construction and mutation. Allows allocating new Gc pointers and internally mutating values held by Gc pointers.

Implementations§

Source§

impl<'gc> Mutation<'gc>

Source

pub fn metrics(&self) -> &Metrics

Source

pub fn backward_barrier(&self, parent: Gc<'gc, ()>, child: Option<Gc<'gc, ()>>)

IF we are in the marking phase AND the parent pointer is colored black AND the child (if given) is colored white, then change the parent color to gray and enqueue it for tracing.

This operation is known as a “backwards write barrier”. Calling this method is one of the safe ways for the value in the parent pointer to use internal mutability to adopt the child pointer without invalidating the color invariant.

If the child parameter is given, then calling this method ensures that the parent pointer may safely adopt the child pointer. If no child is given, then calling this method is more general, and it ensures that the parent pointer may adopt any child pointer(s) before collection is next triggered.

Source

pub fn forward_barrier(&self, parent: Option<Gc<'gc, ()>>, child: Gc<'gc, ()>)

IF we are in the marking phase AND the parent pointer (if given) is colored black, AND the child is colored white, then immediately change the child to gray and enqueue it for tracing.

This operation is known as a “forwards write barrier”. Calling this method is one of the safe ways for the value in the parent pointer to use internal mutability to adopt the child pointer without invalidating the color invariant.

If the parent parameter is given, then calling this method ensures that the parent pointer may safely adopt the child pointer. If no parent is given, then calling this method is more general, and it ensures that the child pointer may be adopted by any parent pointer(s) before collection is next triggered.

Auto Trait Implementations§

§

impl<'gc> !Freeze for Mutation<'gc>

§

impl<'gc> !RefUnwindSafe for Mutation<'gc>

§

impl<'gc> !Send for Mutation<'gc>

§

impl<'gc> !Sync for Mutation<'gc>

§

impl<'gc> Unpin for Mutation<'gc>

§

impl<'gc> !UnwindSafe for Mutation<'gc>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.