1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! List operations, mimicking [`Vec`] in some ways (but not in others).
//!
//! The snippets in this module are only designed for lists that contain
//! elements whose type has [static size](crate::BFieldCodec::static_length).
//! The exception from this rule is [`Map`][self::higher_order::map::Map] (and
//! the more general [`ChainMap`][self::higher_order::map::ChainMap]).
//!
//! Like [`Vec`], a list can be [created][self::new::New],
//! [pushed to][self::push::Push], [popped from][self::pop::Pop],
//! [written to][self::set::Set], [read from][self::get::Get],
//! and asked for its [length][self::length::Length], among other operations.
//!
//! Unlike [`Vec`], lists do not track their capacity. Instead, list created at
//! Triton VM's runtime get access to an entire [memory page][crate::memory].
//! Lists spawned in Triton VM's memory through
//! [non-determinism][crate::triton_vm::prelude::NonDeterminism] might have
//! access to smaller memory regions. As with all non-determinism, handling them
//! requires additional care.
/// The number of VM words required to store the metadata / bookkeeping data of a list.
pub const LIST_METADATA_SIZE: usize = 1;