Skip to main content

SaveSnapshot

Struct SaveSnapshot 

Source
pub struct SaveSnapshot {
    pub d_stack_depth: usize,
    pub packing_mode: bool,
    pub vm_alloc_mode: bool,
    pub object_format: i32,
    pub gstate: GraphicsState,
    pub gstate_stack: Vec<GstateEntry>,
    pub gstate_store_len: usize,
    pub marks: VmMarks,
}
Expand description

Interpreter state captured by save and reinstated by restore.

Grouped into a struct rather than passed positionally: every field is state the interpreter has to rewind, and the set grows as more of the interpreter learns to participate in save/restore.

Fields§

§d_stack_depth: usize

d_stack length at save time (for restore validation).

§packing_mode: bool

Packing mode (setpacking/currentpacking).

§vm_alloc_mode: bool

VM allocation mode (setglobal/currentglobal).

§object_format: i32

Binary object format (setobjectformat/currentobjectformat).

§gstate: GraphicsState

Graphics state and graphics state stack.

§gstate_stack: Vec<GstateEntry>§gstate_store_len: usize

Context::gstate_store length at save time.

gstate_store backs PsValue::Gstate, and a gstate object is a composite in local VM, so restore has to reclaim the ones created after the save. Without this the store would grow monotonically and each stale slot would keep naming entities the restore released.

§marks: VmMarks

Local-VM high-water marks, for reclamation on restore.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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.