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

Function assert_guards

tests/all/memory.rs:224–238  ·  view source on GitHub ↗
(store: &Store<()>, mem: &Memory)

Source from the content-addressed store, hash-verified

222 };
223
224 unsafe fn assert_guards(store: &Store<()>, mem: &Memory) {
225 unsafe {
226 // guards before
227 println!("check pre-mem");
228 assert_faults(mem.data_ptr(&store).offset(-(GUARD_SIZE as isize)));
229
230 // unmapped just after memory
231 println!("check mem");
232 assert_faults(mem.data_ptr(&store).add(mem.data_size(&store)));
233
234 // guards after memory
235 println!("check post-mem");
236 assert_faults(mem.data_ptr(&store).add(1 << 20));
237 }
238 }
239 unsafe {
240 assert_guards(&store, &mem1);
241 assert_guards(&store, &mem2);

Callers 3

guards_presentFunction · 0.85
guards_present_poolingFunction · 0.85

Calls 5

assert_faultsFunction · 0.85
data_ptrMethod · 0.80
offsetMethod · 0.45
addMethod · 0.45
data_sizeMethod · 0.45

Tested by

no test coverage detected