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

Function shared_memory_unsupported

tests/all/pooling_allocator.rs:1304–1331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1302#[test]
1303#[cfg_attr(miri, ignore)]
1304fn shared_memory_unsupported() -> Result<()> {
1305 // Skip this test on platforms that don't support threads.
1306 if crate::threads::engine().is_none() {
1307 return Ok(());
1308 }
1309 let mut config = Config::new();
1310 let mut cfg = PoolingAllocationConfig::default();
1311 // shrink the size of this allocator
1312 cfg.total_memories(1);
1313 config.allocation_strategy(InstanceAllocationStrategy::Pooling(cfg));
1314 let engine = Engine::new(&config)?;
1315
1316 let err = Module::new(
1317 &engine,
1318 r#"
1319 (module
1320 (memory 5 5 shared)
1321 )
1322 "#,
1323 )
1324 .unwrap_err();
1325 err.assert_contains(
1326 "memory is shared which is not supported \
1327 in the pooling allocator",
1328 );
1329 err.assert_contains("memory index 0");
1330 Ok(())
1331}
1332
1333#[test]
1334#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
allocation_strategyMethod · 0.80
assert_containsMethod · 0.80
engineFunction · 0.70
newFunction · 0.50
is_noneMethod · 0.45
total_memoriesMethod · 0.45

Tested by

no test coverage detected