pub struct HeapManager { /* private fields */ }Expand description
Concrete implementation of heap operations for the VM
Wraps the low-level Heap and provides high-level heap management functionality for object allocation and memory operations.
Implementations§
Source§impl HeapManager
impl HeapManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new heap manager with an empty heap
Initializes the heap manager with a fresh heap ready for object allocation and memory management.
Trait Implementations§
Source§impl HeapOperations for HeapManager
impl HeapOperations for HeapManager
Source§fn alloc_object(&mut self) -> HeapHandleId
fn alloc_object(&mut self) -> HeapHandleId
Allocates a new object on the heap Read more
Source§fn alloc_array(&mut self) -> HeapHandleId
fn alloc_array(&mut self) -> HeapHandleId
Allocates a new array on the heap Read more
Source§fn alloc_function(
&mut self,
bytecode: Bytecode,
arg_count: ArgIndex,
local_count: LocalIndex,
) -> HeapHandleId
fn alloc_function( &mut self, bytecode: Bytecode, arg_count: ArgIndex, local_count: LocalIndex, ) -> HeapHandleId
Allocates a new function on the heap Read more
Source§fn get_object_property(&self, handle: HeapHandleId, key: &str) -> Option<&Value>
fn get_object_property(&self, handle: HeapHandleId, key: &str) -> Option<&Value>
Gets a property value from an object Read more
Source§fn set_object_property(
&mut self,
handle: HeapHandleId,
key: String,
value: Value,
)
fn set_object_property( &mut self, handle: HeapHandleId, key: String, value: Value, )
Sets a property value on an object Read more
Source§fn set_array_element(
&mut self,
handle: HeapHandleId,
index: ArraySize,
value: Value,
)
fn set_array_element( &mut self, handle: HeapHandleId, index: ArraySize, value: Value, )
Sets an element in an array Read more
Source§fn get_array_element(
&self,
_handle: HeapHandleId,
_index: ArraySize,
) -> Option<&Value>
fn get_array_element( &self, _handle: HeapHandleId, _index: ArraySize, ) -> Option<&Value>
Gets an element from an array Read more
Source§fn has_object_property(&self, handle: HeapHandleId, key: &str) -> bool
fn has_object_property(&self, handle: HeapHandleId, key: &str) -> bool
Checks if an object has a specific property Read more
Source§fn get_array_length(&self, _handle: HeapHandleId) -> usize
fn get_array_length(&self, _handle: HeapHandleId) -> usize
Gets the length of an array Read more
Auto Trait Implementations§
impl Freeze for HeapManager
impl !RefUnwindSafe for HeapManager
impl !Send for HeapManager
impl !Sync for HeapManager
impl Unpin for HeapManager
impl !UnwindSafe for HeapManager
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