Skip to content

Commit 1ddba49

Browse files
committed
Added init engine static functions for wamr and wasmtime.
Signed-off-by: Rachel Green <[email protected]>
1 parent f401b36 commit 1ddba49

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

include/proxy-wasm/wamr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
namespace proxy_wasm {
2323

24+
bool initWamrEngine();
2425
std::unique_ptr<WasmVm> createWamrVm();
2526

2627
} // namespace proxy_wasm

include/proxy-wasm/wasmtime.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace proxy_wasm {
2020

21+
bool initWasmtimeEngine();
2122
std::unique_ptr<WasmVm> createWasmtimeVm();
2223

2324
} // namespace proxy_wasm

src/wamr/wamr.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,8 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name,
701701

702702
} // namespace wamr
703703

704+
bool initWamrEngine() { return wamr::engine() != nullptr; }
705+
704706
std::unique_ptr<WasmVm> createWamrVm() { return std::make_unique<wamr::Wamr>(); }
705707

706708
} // namespace proxy_wasm

src/wasmtime/wasmtime.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name,
697697

698698
} // namespace wasmtime
699699

700+
bool initWasmtimeEngine() { return wasmtime::engine() != nullptr; }
701+
700702
std::unique_ptr<WasmVm> createWasmtimeVm() { return std::make_unique<wasmtime::Wasmtime>(); }
701703

702704
} // namespace proxy_wasm

0 commit comments

Comments
 (0)