pub struct Heap { /* private fields */ }
Implementations§
Source§impl Heap
impl Heap
pub fn new() -> Self
pub fn sizeof_object() -> usize
Sourcepub fn pause_gc(&mut self)
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).
Sourcepub fn unpause_gc(&mut self)
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).
pub fn set_grow_factor(&mut self, grow_factor: f64)
pub fn alloc_pair<MarkFunc>( &mut self, car: Value, cdr: Value, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_string<MarkFunc>( &mut self, s: String, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_vector<MarkFunc>( &mut self, v: Vec<Value>, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_map<MarkFunc>( &mut self, map: VMHashMap, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_bytes<MarkFunc>( &mut self, v: Vec<u8>, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_lambda<MarkFunc>( &mut self, l: Arc<Chunk>, mark_roots: MarkFunc, ) -> Value
pub fn alloc_closure<MarkFunc>( &mut self, l: Arc<Chunk>, v: Vec<Handle>, mark_roots: MarkFunc, ) -> Value
pub fn alloc_continuation<MarkFunc>( &mut self, k: Continuation, mark_roots: MarkFunc, ) -> Value
pub fn alloc_callframe<MarkFunc>( &mut self, frame: CallFrame, mark_roots: MarkFunc, ) -> Value
pub fn alloc_value<MarkFunc>( &mut self, val: Value, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_error<MarkFunc>( &mut self, error: Error, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn alloc_io<MarkFunc>( &mut self, io: HeapIo, mutable: MutState, mark_roots: MarkFunc, ) -> Value
pub fn get_string(&self, handle: Handle) -> &str
pub fn get_string_mut(&mut self, handle: Handle) -> VMResult<&mut String>
pub fn get_vector(&self, handle: Handle) -> &[Value]
pub fn get_vector_mut(&mut self, handle: Handle) -> VMResult<&mut Vec<Value>>
pub fn get_map(&self, handle: Handle) -> &VMHashMap
pub fn get_map_mut(&mut self, handle: Handle) -> VMResult<&mut VMHashMap>
pub fn get_bytes(&self, handle: Handle) -> &[u8] ⓘ
pub fn get_pair(&self, handle: Handle) -> (Value, Value)
pub fn get_pair_mut( &mut self, handle: Handle, ) -> VMResult<(&mut Value, &mut Value)>
pub fn get_pair_mut_override( &mut self, handle: Handle, ) -> (&mut Value, &mut Value)
pub fn get_lambda(&self, handle: Handle) -> Arc<Chunk>
pub fn get_closure(&self, handle: Handle) -> (Arc<Chunk>, &[Handle])
pub fn get_closure_captures(&self, handle: Handle) -> &[Handle]
pub fn get_continuation(&self, handle: Handle) -> &Continuation
pub fn get_callframe(&self, handle: Handle) -> &CallFrame
pub fn get_value(&self, handle: Handle) -> Value
pub fn get_value_mut(&mut self, handle: Handle) -> &mut Value
pub fn get_error(&self, handle: Handle) -> Error
pub fn get_io(&self, handle: Handle) -> &HeapIo ⓘ
Sourcepub fn is_live(&self, val: Value) -> bool
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.
pub fn immutable(&mut self, val: Value)
pub fn sticky(&mut self, val: Value)
pub fn unsticky(&mut self, val: Value)
pub fn is_traced_and_set(&mut self, val: Value) -> bool
pub fn mark(&mut self, value: Value)
pub fn mark_call_frame(&mut self, call_frame: &CallFrame)
pub fn live_objects(&self) -> usize
pub fn get_property(&self, value: Value, prop: Interned) -> Option<Value>
pub fn set_property(&mut self, key_value: Value, prop: Interned, value: Value)
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more