pub struct GcHeap { /* private fields */ }Expand description
High-level heap API wrapping QuickJS-style GcRuntime.
Implementations§
Source§impl GcHeap
impl GcHeap
pub fn new() -> Self
pub fn malloc_state(&self) -> &MallocState
pub fn malloc_state_mut(&mut self) -> &mut MallocState
pub fn gc_threshold(&self) -> usize
pub fn set_gc_threshold(&mut self, threshold: usize)
pub fn gc_phase(&self) -> GcPhase
pub fn alloc<O: GcObject>(&mut self, object: O, ty: GcObjectType) -> GcRef
pub fn dup(&mut self, reference: GcRef) -> GcRef
pub fn free(&mut self, reference: GcRef)
pub fn run_gc(&mut self)
pub fn run_gc_with_stats(&mut self) -> GcPhaseStats
pub fn run_gc_with_stats_bundle(&mut self) -> GcStatsBundle
pub fn trigger_gc(&mut self, alloc_size: usize)
pub fn is_live(&self, reference: GcRef) -> bool
pub fn exists(&self, reference: GcRef) -> bool
pub fn ref_count(&self, reference: GcRef) -> i32
pub fn mark_children(&mut self, reference: GcRef, mark_func: MarkFunc)
pub fn runtime(&self) -> &GcRuntime
pub fn runtime_mut(&mut self) -> &mut GcRuntime
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GcHeap
impl !Send for GcHeap
impl !Sync for GcHeap
impl !UnwindSafe for GcHeap
impl Freeze for GcHeap
impl Unpin for GcHeap
impl UnsafeUnpin for GcHeap
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