radix_common/constants/
wasm.rs

1/// The maximum memory size (per call frame): 64 * 64KiB = 4MiB
2#[cfg(not(feature = "coverage"))]
3pub const MAX_MEMORY_SIZE_IN_PAGES: u32 = 64;
4#[cfg(feature = "coverage")]
5pub const MAX_MEMORY_SIZE_IN_PAGES: u32 = 512;
6
7/// The maximum initial table size
8pub const MAX_INITIAL_TABLE_SIZE: u32 = 1024;
9
10/// The max number of labels of a table jump, excluding the default
11pub const MAX_NUMBER_OF_BR_TABLE_TARGETS: u32 = 256;
12
13/// The max number of global variables
14pub const MAX_NUMBER_OF_GLOBALS: u32 = 512;
15
16/// The max number of functions
17pub const MAX_NUMBER_OF_FUNCTIONS: u32 = 8 * 1024;
18
19/// The max number of function parameters
20pub const MAX_NUMBER_OF_FUNCTION_PARAMS: u32 = 32;
21
22/// The max number of function local variables
23pub const MAX_NUMBER_OF_FUNCTION_LOCALS: u32 = 256;
24
25/// The number of entries in the engine cache
26pub const WASM_ENGINE_CACHE_SIZE: usize = 1000;
27
28pub const WASM_EXECUTION_COST_UNITS_BUFFER: u32 = 1_000_000;