diff options
author | Till Schneidereit <till@tillschneidereit.net> | 2016-05-24 15:28:25 +0200 |
---|---|---|
committer | Till Schneidereit <till@tillschneidereit.net> | 2016-05-24 17:43:49 +0200 |
commit | 7536afff2a8cd77fd5d0ae6b3324a430eae8ae67 (patch) | |
tree | 793132136678cdcd3403317d19e9ed71a5886969 /components/script/script_runtime.rs | |
parent | 2ce9eba3dc87348c5de235883295f0f6ead4317e (diff) | |
download | servo-7536afff2a8cd77fd5d0ae6b3324a430eae8ae67.tar.gz servo-7536afff2a8cd77fd5d0ae6b3324a430eae8ae67.zip |
Pass a parent JS runtime when creating DOM Worker runtimes
This enables sharing data with the parent runtime, decreasing memory usage and startup time. Also contains an update to current rust-mozjs, because that's required for this to work.
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r-- | components/script/script_runtime.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 543574ccc62..2b2e2437e16 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -95,9 +95,9 @@ impl<'a> Drop for StackRootTLS<'a> { } #[allow(unsafe_code)] -pub unsafe fn new_rt_and_cx() -> Runtime { +pub unsafe fn new_rt_and_cx(parent_rt: *mut JSRuntime) -> Runtime { LiveDOMReferences::initialize(); - let runtime = Runtime::new(); + let runtime = Runtime::new(parent_rt); JS_AddExtraGCRootsTracer(runtime.rt(), Some(trace_rust_roots), ptr::null_mut()); JS_AddExtraGCRootsTracer(runtime.rt(), Some(trace_refcounted_objects), ptr::null_mut()); |