Skip to content

Commit 0b4d880

Browse files
committed
Initialize the CppHeap process before V8
cppgc::InitializeProcess should be called first, so that in V8::Initialize a default call to cppgc::InitializeProcess can be done if it has not happpened.
1 parent 53c8e7c commit 0b4d880

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,10 +1177,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
11771177
result->platform_ = per_process::v8_platform.Platform();
11781178
}
11791179

1180-
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
1181-
V8::Initialize();
1182-
}
1183-
11841180
if (!(flags & ProcessInitializationFlags::kNoInitializeCppgc)) {
11851181
v8::PageAllocator* allocator = nullptr;
11861182
if (result->platform_ != nullptr) {
@@ -1189,6 +1185,10 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
11891185
cppgc::InitializeProcess(allocator);
11901186
}
11911187

1188+
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
1189+
V8::Initialize();
1190+
}
1191+
11921192
#if NODE_USE_V8_WASM_TRAP_HANDLER
11931193
bool use_wasm_trap_handler =
11941194
!per_process::cli_options->disable_wasm_trap_handler;

0 commit comments

Comments
 (0)