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

Method dealloc_bytes

wasmtime-jni/src/ty/wasm_alloc.rs:123–137  ·  view source on GitHub ↗

Deallocate the WasmSlice

(
        &self,
        slice: WasmSlice,
        store: &mut Store<JavaState>,
    )

Source from the content-addressed store, hash-verified

121
122 /// Deallocate the WasmSlice
123 pub fn dealloc_bytes(
124 &self,
125 slice: WasmSlice,
126 store: &mut Store<JavaState>,
127 ) -> Result<(), Error> {
128 let ptr = slice.ptr();
129 let len = slice.len();
130 let mut no_result = [Val::null(); 0];
131 self.dealloc
132 .call(store, &[Val::I32(ptr), Val::I32(len)], &mut no_result)
133 .with_context(|| anyhow!("failed to deallocate bytes"))?;
134
135 debug!("Deallocated offset {} len {}", ptr, len);
136 Ok(())
137 }
138
139 pub fn alloc<T: Sized>(
140 &self,

Callers 1

deallocMethod · 0.80

Calls 4

I32Class · 0.85
ptrMethod · 0.80
lenMethod · 0.80
callMethod · 0.80

Tested by

no test coverage detected