Skip to main content

GcHeap

Struct GcHeap 

Source
pub struct GcHeap { /* private fields */ }
Expand description

High-level heap API wrapping QuickJS-style GcRuntime.

Implementations§

Source§

impl GcHeap

Source

pub fn new() -> Self

Source

pub fn malloc_state(&self) -> &MallocState

Source

pub fn malloc_state_mut(&mut self) -> &mut MallocState

Source

pub fn gc_threshold(&self) -> usize

Source

pub fn set_gc_threshold(&mut self, threshold: usize)

Source

pub fn gc_phase(&self) -> GcPhase

Source

pub fn alloc<O: GcObject>(&mut self, object: O, ty: GcObjectType) -> GcRef

Source

pub fn dup(&mut self, reference: GcRef) -> GcRef

Source

pub fn free(&mut self, reference: GcRef)

Source

pub fn run_gc(&mut self)

Source

pub fn run_gc_with_stats(&mut self) -> GcPhaseStats

Source

pub fn run_gc_with_stats_bundle(&mut self) -> GcStatsBundle

Source

pub fn trigger_gc(&mut self, alloc_size: usize)

Source

pub fn is_live(&self, reference: GcRef) -> bool

Source

pub fn exists(&self, reference: GcRef) -> bool

Source

pub fn ref_count(&self, reference: GcRef) -> i32

Source

pub fn mark_children(&mut self, reference: GcRef, mark_func: MarkFunc)

Source

pub fn runtime(&self) -> &GcRuntime

Source

pub fn runtime_mut(&mut self) -> &mut GcRuntime

Source§

impl GcHeap

Source

pub fn snapshot(&self) -> HeapSnapshot

Trait Implementations§

Source§

impl Default for GcHeap

Source§

fn default() -> Self

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

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.