Add existing instances and move ownership with the export name.
| 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); |