Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2022-04-28 18:08:26 +0300
committerMichaël Zasso <targos@protonmail.com>2022-05-02 15:39:30 +0300
commit37ca1102c457775a6d5b89099bbc7b405272e1ac (patch)
tree535669249fa2990f7c3c2f0c5478c79cc4375534 /src/node_worker.cc
parent1102922ef93fddba03c4919c36db7f14c59c08d5 (diff)
src: make --no-node-snapshot a per-process option
We enable the shared read-only heap which currently requires that the snapshot used in different isolates in the same process to be the same. Therefore --no-node-snapshot is a per-process option. PR-URL: https://github.com/nodejs/node/pull/42864 Refs: https://github.com/nodejs/node/pull/42809 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r--src/node_worker.cc9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc
index 2a509165c25..d8010ff151e 100644
--- a/src/node_worker.cc
+++ b/src/node_worker.cc
@@ -147,14 +147,7 @@ class WorkerThreadData {
SetIsolateCreateParamsForNode(&params);
params.array_buffer_allocator_shared = allocator;
- bool use_node_snapshot = true;
- if (w_->per_isolate_opts_) {
- use_node_snapshot = w_->per_isolate_opts_->node_snapshot;
- } else {
- // IsolateData is created after the Isolate is created so we'll
- // inherit the option from the parent here.
- use_node_snapshot = per_process::cli_options->per_isolate->node_snapshot;
- }
+ bool use_node_snapshot = per_process::cli_options->node_snapshot;
const SnapshotData* snapshot_data =
use_node_snapshot ? SnapshotBuilder::GetEmbeddedSnapshotData()
: nullptr;