Get the default pooling allocator configuration for tests, which is a smaller pool than the normal default.
()
| 107 | /// Get the default pooling allocator configuration for tests, which is a |
| 108 | /// smaller pool than the normal default. |
| 109 | pub(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 | |
| 128 | pub(crate) fn gc_store() -> Result<wasmtime::Store<()>> { |
| 129 | let _ = env_logger::try_init(); |