Skip to content

Commit

Permalink
cli: allow running wasm in limited vmemory with --disable-wasm-trap-h…
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 24, 2024
1 parent ef05fd8 commit 740772b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 40 deletions.

This file was deleted.

9 changes: 7 additions & 2 deletions shell/common/node_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,15 @@ void NodeBindings::Initialize(v8::Local<v8::Context> context) {

// Parse and set Node.js cli flags.
std::vector<std::string> args = ParseNodeCliFlags();

// V8::EnableWebAssemblyTrapHandler can be called only once or it will
// hard crash. We need to prevent Node.js calling it in the event it has
// already been called.
node::per_process::cli_options->disable_wasm_trap_handler = true;

uint64_t process_flags =
node::ProcessInitializationFlags::kNoInitializeV8 |
node::ProcessInitializationFlags::kNoInitializeNodeV8Platform |
node::ProcessInitializationFlags::kNoEnableWasmTrapHandler;
node::ProcessInitializationFlags::kNoInitializeNodeV8Platform;

// We do not want the child processes spawned from the utility process
// to inherit the custom stdio handles created for the parent.
Expand Down

0 comments on commit 740772b

Please sign in to comment.