From 4128055d76ec1fd78edd688dcfff4b8f28322feb Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 14 Apr 2022 21:51:44 +0800 Subject: [PATCH] fixup! bootstrap: move embedded snapshot to SnapshotBuilder Co-authored-by: Anna Henningsen --- src/node_snapshotable.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index 33691557e65d7b..d032ea958392df 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -92,14 +92,8 @@ const SnapshotData* SnapshotBuilder::GetEmbeddedSnapshotData() { return ss.str(); } -std::unique_ptr SnapshotBuilder::registry_ = nullptr; -Mutex SnapshotBuilder::snapshot_data_mutex_; - const std::vector& SnapshotBuilder::CollectExternalReferences() { - Mutex::ScopedLock lock(snapshot_data_mutex_); - if (registry_ == nullptr) { - registry_.reset(new ExternalReferenceRegistry()); - } + static auto registry = std::make_unique(); return registry_->external_references(); }