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 217320a commit 2b55995Copy full SHA for 2b55995
src/v8/v8.cc
@@ -18,20 +18,29 @@
18
#include <cassert>
19
#include <iomanip>
20
#include <memory>
21
+#include <mutex>
22
#include <optional>
23
#include <sstream>
24
#include <unordered_map>
25
#include <utility>
26
#include <vector>
27
28
+#include "v8.h"
29
#include "v8-version.h"
30
#include "wasm-api/wasm.hh"
31
32
namespace proxy_wasm {
33
namespace {
34
35
wasm::Engine *engine() {
- static const auto engine = wasm::Engine::make();
36
+ static std::once_flag init;
37
+ static wasm::own<wasm::Engine> engine;
38
+
39
+ std::call_once(init, []() {
40
+ v8::V8::EnableWebAssemblyTrapHandler(true);
41
+ engine = wasm::Engine::make();
42
+ });
43
44
return engine.get();
45
}
46
0 commit comments