summaryrefslogtreecommitdiff
path: root/cli/ops.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-08 10:12:43 -0400
committerGitHub <noreply@github.com>2019-04-08 10:12:43 -0400
commitf7fdb90fd51e340ea598c055bb3573d3cdfbdaa8 (patch)
tree40db117b3a9fd2ac70e3b5551195e21eef464138 /cli/ops.rs
parentcdb72afd8d91978573f0fa897844aee853983b44 (diff)
core: snapshot improvements (#2052)
* Moves how snapshots are supplied to the Isolate. Previously they were given by Behavior::startup_data() but it was only called once at startup. It makes more sense (and simplifies Behavior) to pass it to the constructor of Isolate. * Adds new libdeno type deno_snapshot instead of overloading deno_buf. * Adds new libdeno method to delete snapshot deno_snapshot_delete(). * Renames deno_get_snapshot() to deno_snapshot_new(). * Makes StartupData hold references to snapshots. This was implicit when it previously held a deno_buf but is made explicit now. Note that include_bytes!() returns a &'static [u8] and we want to avoid copying that.
Diffstat (limited to 'cli/ops.rs')
-rw-r--r--cli/ops.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/ops.rs b/cli/ops.rs
index 889061651..a0169d6ab 100644
--- a/cli/ops.rs
+++ b/cli/ops.rs
@@ -15,6 +15,7 @@ use crate::resolve_addr::resolve_addr;
use crate::resources;
use crate::resources::table_entries;
use crate::resources::Resource;
+use crate::startup_data;
use crate::tokio_util;
use crate::tokio_write;
use crate::version;
@@ -1865,6 +1866,7 @@ fn op_create_worker(
parent_state.argv.clone(),
);
match workers::spawn(
+ startup_data::deno_isolate_init(),
behavior,
&format!("USER-WORKER-{}", specifier),
workers::WorkerInit::Module(specifier.to_string()),