mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02: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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user