MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / DefineUnknownImportsAsDefaultValues

Method DefineUnknownImportsAsDefaultValues

linker.go:222–236  ·  view source on GitHub ↗

DefineUnknownImportsAsDefaultValues defines all otherwise-missing imports of the module as values that return the default for their type. Returns an error if the imports could not be defined.

(store Storelike, module *Module)

Source from the content-addressed store, hash-verified

220//
221// Returns an error if the imports could not be defined.
222func (l *Linker) DefineUnknownImportsAsDefaultValues(store Storelike, module *Module) error {
223 err := C.wasmtime_linker_define_unknown_imports_as_default_values(
224 l.ptr(),
225 store.Context(),
226 module.ptr(),
227 )
228 runtime.KeepAlive(l)
229 runtime.KeepAlive(store)
230 runtime.KeepAlive(module)
231 if err == nil {
232 return nil
233 }
234
235 return mkError(err)
236}
237
238// Instantiate instantiates a module with all imports defined in this linker.
239//

Calls 3

ptrMethod · 0.95
mkErrorFunction · 0.85
ContextMethod · 0.65