mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
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.
This commit is contained in:
parent
2ce9eba3dc
commit
7536afff2a
7 changed files with 22 additions and 13 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue