slvm::heap

Struct Heap

Source
pub struct Heap { /* private fields */ }

Implementations§

Source§

impl Heap

Source

pub fn new() -> Self

Source

pub fn sizeof_object() -> usize

Source

pub fn pause_gc(&mut self)

Pause garbage collection. Each pause_gc must have an unpause_gc before GC resumes (it is a counter that must be 0).

Source

pub fn unpause_gc(&mut self)

UnPause garbage collection. Each pause_gc must have an unpause_gc before GC resumes (it is a counter that must be 0).

Source

pub fn set_grow_factor(&mut self, grow_factor: f64)

Source

pub fn alloc_pair<MarkFunc>( &mut self, car: Value, cdr: Value, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_string<MarkFunc>( &mut self, s: String, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_vector<MarkFunc>( &mut self, v: Vec<Value>, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_map<MarkFunc>( &mut self, map: VMHashMap, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_bytes<MarkFunc>( &mut self, v: Vec<u8>, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_lambda<MarkFunc>( &mut self, l: Arc<Chunk>, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_closure<MarkFunc>( &mut self, l: Arc<Chunk>, v: Vec<Handle>, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_continuation<MarkFunc>( &mut self, k: Continuation, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_callframe<MarkFunc>( &mut self, frame: CallFrame, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_value<MarkFunc>( &mut self, val: Value, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_error<MarkFunc>( &mut self, error: Error, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn alloc_io<MarkFunc>( &mut self, io: HeapIo, mutable: MutState, mark_roots: MarkFunc, ) -> Value
where MarkFunc: FnMut(&mut Heap) -> VMResult<()>,

Source

pub fn get_string(&self, handle: Handle) -> &str

Source

pub fn get_string_mut(&mut self, handle: Handle) -> VMResult<&mut String>

Source

pub fn get_vector(&self, handle: Handle) -> &[Value]

Source

pub fn get_vector_mut(&mut self, handle: Handle) -> VMResult<&mut Vec<Value>>

Source

pub fn get_map(&self, handle: Handle) -> &VMHashMap

Source

pub fn get_map_mut(&mut self, handle: Handle) -> VMResult<&mut VMHashMap>

Source

pub fn get_bytes(&self, handle: Handle) -> &[u8]

Source

pub fn get_pair(&self, handle: Handle) -> (Value, Value)

Source

pub fn get_pair_mut( &mut self, handle: Handle, ) -> VMResult<(&mut Value, &mut Value)>

Source

pub fn get_pair_mut_override( &mut self, handle: Handle, ) -> (&mut Value, &mut Value)

Source

pub fn get_lambda(&self, handle: Handle) -> Arc<Chunk>

Source

pub fn get_closure(&self, handle: Handle) -> (Arc<Chunk>, &[Handle])

Source

pub fn get_closure_captures(&self, handle: Handle) -> &[Handle]

Source

pub fn get_continuation(&self, handle: Handle) -> &Continuation

Source

pub fn get_callframe(&self, handle: Handle) -> &CallFrame

Source

pub fn get_value(&self, handle: Handle) -> Value

Source

pub fn get_value_mut(&mut self, handle: Handle) -> &mut Value

Source

pub fn get_error(&self, handle: Handle) -> Error

Source

pub fn get_io(&self, handle: Handle) -> &HeapIo

Source

pub fn is_live(&self, val: Value) -> bool

If val is on the heap is it still alive after GC Return true if val is not a heap object.

Source

pub fn immutable(&mut self, val: Value)

Source

pub fn sticky(&mut self, val: Value)

Source

pub fn unsticky(&mut self, val: Value)

Source

pub fn is_traced_and_set(&mut self, val: Value) -> bool

Source

pub fn mark(&mut self, value: Value)

Source

pub fn mark_call_frame(&mut self, call_frame: &CallFrame)

Source

pub fn live_objects(&self) -> usize

Source

pub fn get_property(&self, value: Value, prop: Interned) -> Option<Value>

Source

pub fn set_property(&mut self, key_value: Value, prop: Interned, value: Value)

Trait Implementations§

Source§

impl Default for Heap

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Heap

§

impl RefUnwindSafe for Heap

§

impl !Send for Heap

§

impl !Sync for Heap

§

impl Unpin for Heap

§

impl UnwindSafe for Heap

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.