MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / get_func

Method get_func

crates/tinywasm/src/store/mod.rs:141–149  ·  view source on GitHub ↗

Get the function at the actual index in the store

(&self, addr: FuncAddr)

Source from the content-addressed store, hash-verified

139impl State {
140 /// Get the function at the actual index in the store
141 pub(crate) fn get_func(&self, addr: FuncAddr) -> &FunctionInstance {
142 match self.funcs.get(addr as usize) {
143 Some(func) => func,
144 None => {
145 cold_path();
146 unreachable!("function {addr} not found. This should be unreachable")
147 }
148 }
149 }
150
151 /// Get a wasm function at the actual index in the store, panicking if it's a host function (which should be guaranteed by the validator)
152 pub(crate) fn get_wasm_func(&self, addr: FuncAddr) -> &WasmFunctionInstance {

Callers 12

call_innerMethod · 0.80
call_resumable_innerMethod · 0.80
call_untypedMethod · 0.80
resume_with_fuelMethod · 0.80
func_untypedMethod · 0.80
func_by_indexMethod · 0.80
start_funcMethod · 0.80
linkMethod · 0.80
exec_call_directMethod · 0.80
exec_call_indirectMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected