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

Method get_from_func_ref

cranelift/interpreter/src/environment.rs:53–59  ·  view source on GitHub ↗

Retrieve a function from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as currently it retrieves the function name as a string and performs string matching.

(
        &self,
        func_ref: FuncRef,
        function: &Function,
    )

Source from the content-addressed store, hash-verified

51 /// Retrieve a function from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as
52 /// currently it retrieves the function name as a string and performs string matching.
53 pub fn get_from_func_ref(
54 &self,
55 func_ref: FuncRef,
56 function: &Function,
57 ) -> Option<&'a Function> {
58 self.get_by_name(&get_function_name(func_ref, function))
59 }
60}
61
62/// Retrieve a function name from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as

Callers 1

get_functionMethod · 0.80

Calls 2

get_function_nameFunction · 0.85
get_by_nameMethod · 0.80

Tested by

no test coverage detected