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

Method init_funcs

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

Add functions to the store, returning their addresses in the store

(
        &mut self,
        funcs: &[Arc<WasmFunction>],
        idx: ModuleInstanceAddr,
    )

Source from the content-addressed store, hash-verified

328impl Store {
329 /// Add functions to the store, returning their addresses in the store
330 pub(crate) fn init_funcs(
331 &mut self,
332 funcs: &[Arc<WasmFunction>],
333 idx: ModuleInstanceAddr,
334 ) -> impl ExactSizeIterator<Item = FuncAddr> {
335 let start = self.state.funcs.len() as FuncAddr;
336 self.state.funcs.extend(funcs.iter().map(|func| FunctionInstance::new_wasm(func.clone(), idx)));
337 start..start + funcs.len() as FuncAddr
338 }
339
340 /// Add tables to the store, returning their addresses in the store
341 pub(crate) fn init_tables(&mut self, tables: &[TableType]) -> impl ExactSizeIterator<Item = TableAddr> {

Callers 1

instantiate_no_startMethod · 0.80

Calls 2

mapMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected