MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / addHostFunc

Method addHostFunc

include/runtime/instance/module.h:123–131  ·  view source on GitHub ↗

Add existing instances and move ownership with the export name.

Source from the content-addressed store, hash-verified

121
122 /// Add existing instances and move ownership with the export name.
123 void addHostFunc(std::string_view Name,
124 std::unique_ptr<HostFunctionBase> &&Func) {
125 std::unique_lock Lock(Mutex);
126 unsafeImportDefinedType(Func->getDefinedType());
127 unsafeAddHostInstance(
128 Name, OwnedFuncInsts, FuncInsts, ExpFuncs,
129 std::make_unique<FunctionInstance>(
130 this, static_cast<uint32_t>(Types.size()) - 1, std::move(Func)));
131 }
132 void addHostFunc(std::string_view Name,
133 std::unique_ptr<FunctionInstance> &&Func) {
134 std::unique_lock Lock(Mutex);

Callers 3

TESTFunction · 0.80
TESTFunction · 0.80

Calls 3

isHostFunctionMethod · 0.80
linkDefinedTypeMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64