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

Method drop

tests/all/stack_creator.rs:86–98  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

84}
85impl Drop for CustomStackCreator {
86 fn drop(&mut self) {
87 let page_size = rustix::param::page_size();
88 unsafe {
89 // Unprotect the guard page as the allocator could reuse it.
90 rustix::mm::mprotect(
91 self.memory.as_ptr().cast(),
92 page_size,
93 rustix::mm::MprotectFlags::READ | rustix::mm::MprotectFlags::WRITE,
94 )
95 .unwrap();
96 System.dealloc(self.memory.as_ptr(), self.layout);
97 }
98 }
99}
100unsafe impl StackCreator for CustomStackCreator {
101 fn new_stack(&self, size: usize, zeroed: bool) -> Result<Box<dyn StackMemory>> {

Callers

nothing calls this directly

Calls 4

unwrapMethod · 0.45
castMethod · 0.45
as_ptrMethod · 0.45
deallocMethod · 0.45

Tested by

no test coverage detected