MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / small_pool_config

Function small_pool_config

tests/all/main.rs:109–126  ·  view source on GitHub ↗

Get the default pooling allocator configuration for tests, which is a smaller pool than the normal default.

()

Source from the content-addressed store, hash-verified

107/// Get the default pooling allocator configuration for tests, which is a
108/// smaller pool than the normal default.
109pub(crate) fn small_pool_config() -> wasmtime::PoolingAllocationConfig {
110 let mut config = wasmtime::PoolingAllocationConfig::new();
111
112 config.total_memories(1);
113 config.max_memory_size(1 << 16);
114 config.total_tables(1);
115 config.table_elements(10);
116
117 // When testing, we may choose to start with MPK force-enabled to ensure
118 // we use that functionality.
119 if std::env::var("WASMTIME_TEST_FORCE_MPK").is_ok() {
120 config.memory_protection_keys(wasmtime::Enabled::No);
121 }
122
123 config.total_stacks(1);
124
125 config
126}
127
128pub(crate) fn gc_store() -> Result<wasmtime::Store<()>> {
129 let _ = env_logger::try_init();

Callers 15

linear_memory_limitsFunction · 0.70
successful_instantiationFunction · 0.70
memory_limitFunction · 0.70
memory_initFunction · 0.70
memory_guard_page_trapFunction · 0.70
memory_zeroedFunction · 0.70
table_limitFunction · 0.70
table_initFunction · 0.70

Calls 8

is_okMethod · 0.80
newFunction · 0.50
total_memoriesMethod · 0.45
max_memory_sizeMethod · 0.45
total_tablesMethod · 0.45
table_elementsMethod · 0.45
total_stacksMethod · 0.45