MCPcopy Create free account
hub / github.com/bluejekyll/wasmtime-java / dealloc

Method dealloc

wasmtime-jni/src/ty/wasm_alloc.rs:168–178  ·  view source on GitHub ↗
(
        &self,
        ptr: i32,
        store: &mut Store<JavaState>,
    )

Source from the content-addressed store, hash-verified

166
167 #[allow(unused)]
168 pub unsafe fn dealloc<T: Sized>(
169 &self,
170 ptr: i32,
171 store: &mut Store<JavaState>,
172 ) -> Result<(), Error> {
173 debug_assert!(ptr > 0);
174 let len = i32::try_from(mem::size_of::<T>())?;
175 let wasm_slice = WasmSlice::new(ptr, len);
176
177 self.dealloc_bytes(wasm_slice, store)
178 }
179}
180
181/// This is use to free memory after a function call

Callers

nothing calls this directly

Calls 1

dealloc_bytesMethod · 0.80

Tested by

no test coverage detected