tasm-lib 2.0.0

Code snippets for Triton VM assembly with tests and statistics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::collections::HashMap;

use triton_vm::prelude::*;

use crate::empty_stack;
use crate::memory::dyn_malloc::DynMalloc;
use crate::traits::function::Function;

/// Return a pointer to the next free page of memory, and update the dyn malloc
/// state accordingly.
pub fn dynamic_allocator(memory: &mut HashMap<BFieldElement, BFieldElement>) -> BFieldElement {
    let mut init_stack = empty_stack();
    DynMalloc.rust_shadow(&mut init_stack, memory);
    init_stack.pop().unwrap()
}