diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/isolate.rs | 13 | ||||
-rw-r--r-- | src/libdeno.rs | 6 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/isolate.rs b/src/isolate.rs index df13fca96..e222d280f 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -100,6 +100,15 @@ pub struct Metrics { static DENO_INIT: std::sync::Once = std::sync::ONCE_INIT; +fn empty() -> libdeno::deno_buf { + libdeno::deno_buf { + alloc_ptr: std::ptr::null_mut(), + alloc_len: 0, + data_ptr: std::ptr::null_mut(), + data_len: 0, + } +} + impl Isolate { pub fn new( flags: flags::DenoFlags, @@ -109,9 +118,9 @@ impl Isolate { DENO_INIT.call_once(|| { unsafe { libdeno::deno_init() }; }); - + let shared = empty(); // TODO Use shared for message passing. let libdeno_isolate = unsafe { - libdeno::deno_new(snapshot::deno_snapshot.clone(), pre_dispatch) + libdeno::deno_new(snapshot::deno_snapshot.clone(), shared, pre_dispatch) }; // This channel handles sending async messages back to the runtime. let (tx, rx) = mpsc::channel::<(i32, Buf)>(); diff --git a/src/libdeno.rs b/src/libdeno.rs index 812cd4620..bb0509e01 100644 --- a/src/libdeno.rs +++ b/src/libdeno.rs @@ -28,7 +28,11 @@ extern "C" { pub fn deno_init(); pub fn deno_v8_version() -> *const c_char; pub fn deno_set_v8_flags(argc: *mut c_int, argv: *mut *mut c_char); - pub fn deno_new(snapshot: deno_buf, cb: DenoRecvCb) -> *const isolate; + pub fn deno_new( + snapshot: deno_buf, + shared: deno_buf, + cb: DenoRecvCb, + ) -> *const isolate; pub fn deno_delete(i: *const isolate); pub fn deno_last_exception(i: *const isolate) -> *const c_char; pub fn deno_check_promise_errors(i: *const isolate); |