Skip to main content

Arena

Struct Arena 

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

Implementations§

Source§

impl Arena

Source

pub fn new() -> Self

Source

pub fn push(&mut self, entry: ArenaEntry) -> u32

Source

pub fn push_symbol(&mut self, symbol: ArenaSymbol) -> u32

Source

pub fn get(&self, index: u32) -> &ArenaEntry

Source

pub fn is_stable_index(index: u32) -> bool

Source

pub fn is_yard_index_in_region(&self, index: u32, mark: u32) -> bool

Source

pub fn is_handoff_index_in_region(&self, index: u32, mark: u32) -> bool

Source

pub fn is_young_index_in_region(&self, index: u32, mark: u32) -> bool

Source

pub fn young_len(&self) -> usize

Source

pub fn yard_len(&self) -> usize

Source

pub fn handoff_len(&self) -> usize

Source

pub fn stable_len(&self) -> usize

Source

pub fn usage(&self) -> ArenaUsage

Source

pub fn peak_usage(&self) -> ArenaUsage

Source

pub fn is_frame_local_index( &self, index: u32, arena_mark: u32, yard_mark: u32, handoff_mark: u32, ) -> bool

Source

pub fn with_alloc_space<T>( &mut self, space: AllocSpace, f: impl FnOnce(&mut Arena) -> T, ) -> T

Source

pub fn push_i64(&mut self, val: i64) -> u32

Source

pub fn push_string(&mut self, s: &str) -> u32

Source

pub fn push_boxed(&mut self, val: NanValue) -> u32

Source

pub fn push_record(&mut self, type_id: u32, fields: Vec<NanValue>) -> u32

Source

pub fn push_variant( &mut self, type_id: u32, variant_id: u16, fields: Vec<NanValue>, ) -> u32

Source

pub fn push_list(&mut self, items: Vec<NanValue>) -> u32

Source

pub fn push_map(&mut self, map: PersistentMap) -> u32

Source

pub fn push_tuple(&mut self, items: Vec<NanValue>) -> u32

Source

pub fn push_vector(&mut self, items: Vec<NanValue>) -> u32

Source

pub fn push_fn(&mut self, f: Rc<FunctionValue>) -> u32

Source

pub fn push_builtin(&mut self, name: &str) -> u32

Source

pub fn push_nullary_variant_symbol(&mut self, ctor_id: u32) -> u32

Source

pub fn get_i64(&self, index: u32) -> i64

Source

pub fn get_string(&self, index: u32) -> &str

Source

pub fn get_string_value(&self, value: NanValue) -> NanString<'_>

Source

pub fn get_boxed(&self, index: u32) -> NanValue

Source

pub fn get_record(&self, index: u32) -> (u32, &[NanValue])

Source

pub fn get_variant(&self, index: u32) -> (u32, u16, &[NanValue])

Source

pub fn get_list(&self, index: u32) -> &ArenaList

Source

pub fn get_tuple(&self, index: u32) -> &[NanValue]

Source

pub fn get_vector(&self, index: u32) -> &[NanValue]

Source

pub fn vector_ref_value(&self, value: NanValue) -> &[NanValue]

Source

pub fn clone_vector_value(&self, value: NanValue) -> Vec<NanValue>

Source

pub fn get_map(&self, index: u32) -> &PersistentMap

Source

pub fn map_ref_value(&self, map: NanValue) -> &PersistentMap

Source

pub fn clone_map_value(&self, map: NanValue) -> PersistentMap

Source

pub fn get_fn(&self, index: u32) -> &FunctionValue

Source

pub fn get_fn_rc(&self, index: u32) -> &Rc<FunctionValue>

Source

pub fn get_builtin(&self, index: u32) -> &str

Source

pub fn get_namespace(&self, index: u32) -> (&str, &[(Rc<str>, NanValue)])

Source

pub fn get_nullary_variant_ctor(&self, index: u32) -> u32

Source

pub fn register_record_type( &mut self, name: &str, field_names: Vec<String>, ) -> u32

Source

pub fn register_sum_type( &mut self, name: &str, variant_names: Vec<String>, ) -> u32

Source

pub fn register_variant_name( &mut self, type_id: u32, variant_name: String, ) -> u16

Source

pub fn get_type_name(&self, type_id: u32) -> &str

Source

pub fn type_count(&self) -> u32

Source

pub fn get_field_names(&self, type_id: u32) -> &[String]

Source

pub fn get_variant_name(&self, type_id: u32, variant_id: u16) -> &str

Source

pub fn find_type_id(&self, name: &str) -> Option<u32>

Source

pub fn find_variant_id(&self, type_id: u32, variant_name: &str) -> Option<u16>

Source

pub fn find_ctor_id(&self, type_id: u32, variant_id: u16) -> Option<u32>

Source

pub fn get_ctor_parts(&self, ctor_id: u32) -> (u32, u16)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source§

impl Arena

Source

pub fn push_list_prepend(&mut self, head: NanValue, tail: NanValue) -> u32

Source

pub fn push_list_append(&mut self, list: NanValue, value: NanValue) -> u32

Source

pub fn push_list_concat(&mut self, left: NanValue, right: NanValue) -> u32

Source

pub fn list_len_value(&self, list: NanValue) -> usize

Source

pub fn list_is_empty_value(&self, list: NanValue) -> bool

Source

pub fn list_get_value( &self, list: NanValue, position: usize, ) -> Option<NanValue>

Source

pub fn list_to_vec_value(&self, list: NanValue) -> Vec<NanValue>

Source

pub fn list_len(&self, index: u32) -> usize

Source

pub fn list_is_empty(&self, index: u32) -> bool

Source

pub fn list_get(&self, index: u32, position: usize) -> Option<NanValue>

Source

pub fn list_to_vec(&self, index: u32) -> Vec<NanValue>

Source

pub fn list_uncons(&mut self, list: NanValue) -> Option<(NanValue, NanValue)>

Source§

impl Arena

Source

pub fn truncate_to(&mut self, mark: u32)

Source

pub fn collect_young_from_roots(&mut self, mark: u32, roots: &mut [NanValue])

Source

pub fn truncate_yard_to(&mut self, mark: u32)

Source

pub fn truncate_handoff_to(&mut self, mark: u32)

Source

pub fn evacuate_frame_to_yard( &mut self, young_mark: u32, yard_mark: u32, handoff_mark: u32, roots: &mut [NanValue], ) -> (bool, bool)

Source

pub fn evacuate_frame_to_handoff( &mut self, young_mark: u32, yard_mark: u32, handoff_mark: u32, roots: &mut [NanValue], ) -> (bool, bool)

Source

pub fn flatten_deep_list(&mut self, value: NanValue) -> NanValue

Flatten a deep list (Prepend/Concat chain) into a single Flat entry. Returns the original value unchanged if not a deep list. Uses the existing iterative list_to_vec — no recursion, no stack overflow.

Source

pub fn promote_young_roots_to_yard(&mut self, mark: u32, roots: &mut [NanValue])

Source

pub fn promote_young_roots_to_handoff( &mut self, mark: u32, roots: &mut [NanValue], )

Source

pub fn promote_roots_to_stable(&mut self, roots: &mut [NanValue])

Source

pub fn collect_yard_from_roots(&mut self, mark: u32, roots: &mut [NanValue])

Source

pub fn collect_stable_from_roots(&mut self, roots: &mut [NanValue])

Trait Implementations§

Source§

impl Clone for Arena

Source§

fn clone(&self) -> Arena

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Arena

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Arena

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Arena

§

impl RefUnwindSafe for Arena

§

impl !Send for Arena

§

impl !Sync for Arena

§

impl Unpin for Arena

§

impl UnsafeUnpin for Arena

§

impl UnwindSafe for Arena

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V