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

Function respect_tunables

crates/wasmtime/src/runtime/memory.rs:1105–1121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1103 // in `Config`.
1104 #[test]
1105 fn respect_tunables() {
1106 let mut cfg = Config::new();
1107 cfg.memory_reservation(0).memory_guard_size(0);
1108 let mut store = Store::new(&Engine::new(&cfg).unwrap(), ());
1109 let ty = MemoryType::new(1, None);
1110 let mem = Memory::new(&mut store, ty).unwrap();
1111 let store = store.as_context();
1112 let tunables = store.engine().tunables();
1113 assert_eq!(tunables.memory_guard_size, 0);
1114 assert!(!mem.wasmtime_ty(store.0).can_elide_bounds_check(
1115 &wasmtime_environ::MemoryTunables::new(
1116 tunables,
1117 wasmtime_environ::MemoryKind::LinearMemory,
1118 ),
1119 12,
1120 ));
1121 }
1122
1123 #[test]
1124 fn hash_key_is_stable_across_duplicate_store_data_entries() -> Result<()> {

Callers

nothing calls this directly

Calls 7

newFunction · 0.50
memory_guard_sizeMethod · 0.45
memory_reservationMethod · 0.45
unwrapMethod · 0.45
as_contextMethod · 0.45
tunablesMethod · 0.45
engineMethod · 0.45

Tested by

no test coverage detected