Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/proxy-wasm/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class WasmBase : public std::enable_shared_from_this<WasmBase> {
WasmCallVoid<0> _start_; /* WASI command (Emscripten v1.39.0+, TinyGo) */

WasmCallWord<2> main_;
WasmCallWord<0> __main_void_;

WasmCallWord<1> malloc_;

// Calls into the VM.
Expand Down
4 changes: 2 additions & 2 deletions include/proxy-wasm/wasm_vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ using WasmCallWord = std::function<WasmCallInFuncType<N, Word, ContextBase *, Wo
#define FOR_ALL_WASM_VM_EXPORTS(_f) \
_f(proxy_wasm::WasmCallVoid<0>) _f(proxy_wasm::WasmCallVoid<1>) _f(proxy_wasm::WasmCallVoid<2>) \
_f(proxy_wasm::WasmCallVoid<3>) _f(proxy_wasm::WasmCallVoid<5>) \
_f(proxy_wasm::WasmCallWord<1>) _f(proxy_wasm::WasmCallWord<2>) \
_f(proxy_wasm::WasmCallWord<3>)
_f(proxy_wasm::WasmCallWord<0>) _f(proxy_wasm::WasmCallWord<1>) \
_f(proxy_wasm::WasmCallWord<2>) _f(proxy_wasm::WasmCallWord<3>)

// These are templates and its helper for constructing signatures of functions callbacks from Wasm
// VMs.
Expand Down
3 changes: 3 additions & 0 deletions src/wasm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void WasmBase::getFunctions() {
_GET(_initialize);
if (_initialize_) {
_GET(main);
_GET(__main_void);
} else {
_GET(_start);
}
Expand Down Expand Up @@ -410,6 +411,8 @@ void WasmBase::startVm(ContextBase *root_context) {
// Re-using main() keeps this consistent when switching between
// WASI command (that calls main()) and reactor (that doesn't).
main_(root_context, Word(0), Word(0));
} else if (__main_void_) {
__main_void_(root_context);
}
} else if (_start_) {
// WASI command.
Expand Down
Loading