We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d7d65c commit 15bcfb0Copy full SHA for 15bcfb0
src/wamr/wamr.cc
@@ -296,7 +296,11 @@ bool Wamr::link(std::string_view /*debug_name*/) {
296
return false;
297
}
298
299
- wasm_extern_vec_t imports_vec = {imports.size(), imports.data()};
+ //TODO workaround
300
+ // it's better to create `wasm_extern_vec_t` via `wasm_extern_vec_new_xxx()`
301
+ // maybe one solution is to replace `std::vector<wasm_extern_t *>>` with `wasm_extern_vec_t`
302
+ // to avoid a data copy
303
+ wasm_extern_vec_t imports_vec = {imports.size(), imports.data(), imports.size()};
304
instance_ = wasm_instance_new(store_.get(), module_.get(), &imports_vec, nullptr);
305
if (instance_ == nullptr) {
306
fail(FailState::UnableToInitializeCode, "Failed to create new Wasm instance");
0 commit comments