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

Method free_memory

cranelift/jit/src/memory/arena.rs:198–206  ·  view source on GitHub ↗

Frees the allocated memory region, which would be leaked otherwise. Likely to invalidate existing function pointers, causing unsafety.

(&mut self)

Source from the content-addressed store, hash-verified

196 /// Frees the allocated memory region, which would be leaked otherwise.
197 /// Likely to invalidate existing function pointers, causing unsafety.
198 pub(crate) unsafe fn free_memory(&mut self) {
199 if self.ptr == ptr::null_mut() {
200 return;
201 }
202 self.segments.clear();
203 // Drop the allocation, freeing memory.
204 let _: Option<region::Allocation> = self.alloc.take();
205 self.ptr = ptr::null_mut();
206 }
207}
208
209impl Drop for ArenaMemoryProvider {

Callers 2

dropMethod · 0.45
large_virtual_allocationFunction · 0.45

Calls 2

clearMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected