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

Method from_caller

wasmtime-jni/src/ty/wasm_alloc.rs:28–38  ·  view source on GitHub ↗
(caller: &mut Caller<JavaState>)

Source from the content-addressed store, hash-verified

26
27impl WasmAlloc {
28 pub fn from_caller(caller: &mut Caller<JavaState>) -> Option<Self> {
29 let memory = caller
30 .get_export(MEMORY_EXPORT)
31 .and_then(Extern::into_memory);
32 let alloc = caller.get_export(ALLOC_EXPORT).and_then(Extern::into_func);
33 let dealloc = caller
34 .get_export(DEALLOC_EXPORT)
35 .and_then(Extern::into_func);
36
37 Self::from(memory, alloc, dealloc)
38 }
39
40 pub fn from_instance(instance: &Instance, mut store: impl AsContextMut) -> Option<Self> {
41 Self::from(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected