Expand description
Implementation of the VM’s memory.
§Memory Addressing Limits
The VM uses u32 addresses, theoretically allowing up to 2^32 memory slots. However, practical limits apply:
-
Rust allocator limit: All allocations are capped at
isize::MAXbytes. On 32-bit systems, this limits addressable memory to approximatelyi32::MAX / sizeof(MemoryValue)elements (~44 million with typical element sizes). -
RAM limit: On 64-bit systems, the allocator limit is not a concern, but allocating the full u32 address space would require ~200 GB of RAM.
Modules§
- offsets
- Offset constants for arrays and vectors:
Structs§
- Array
Address 🔒 - Wrapper for array addresses, with convenience methods for various offsets.
- Memory
- The VM’s memory.
Enums§
- Memory
Type Error - Represents errors that can occur when interpreting or converting typed memory values.
- Memory
Value - A single typed value in the Brillig VM’s memory.
Constants§
- FREE_
MEMORY_ POINTER_ ADDRESS - The free memory pointer is always in slot 1.
- MEMORY_
ADDRESSING_ BIT_ SIZE - The bit size used for addressing memory within the Brillig VM.
- STACK_
POINTER_ ADDRESS - The current stack pointer is always in slot 0.