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

Function component_instance_size_limit

tests/all/pooling_allocator.rs:868–886  ·  view source on GitHub ↗

error message tailored for 64-bit

()

Source from the content-addressed store, hash-verified

866#[cfg(feature = "component-model")]
867#[cfg(target_pointer_width = "64")] // error message tailored for 64-bit
868fn component_instance_size_limit() -> Result<()> {
869 let mut pool = crate::small_pool_config();
870 pool.max_component_instance_size(1);
871 let mut config = Config::new();
872 config.wasm_component_model(true);
873 config.allocation_strategy(pool);
874 let engine = Engine::new(&config)?;
875
876 match wasmtime::component::Component::new(&engine, "(component)") {
877 Ok(_) => panic!("should have hit limit"),
878 Err(e) => {
879 e.assert_contains("instance allocation for this component requires 64 bytes");
880 e.assert_contains("which exceeds the configured maximum of 1 bytes");
881 e.assert_contains("`VMComponentContext` used 64 bytes");
882 }
883 }
884
885 Ok(())
886}
887
888#[test]
889#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
allocation_strategyMethod · 0.80
assert_containsMethod · 0.80
small_pool_configFunction · 0.70
newFunction · 0.50
wasm_component_modelMethod · 0.45

Tested by

no test coverage detected