aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-04-10 12:56:46 +0200
committerMs2ger <ms2ger@gmail.com>2015-04-10 14:53:18 +0200
commitd46db6d7f1f10d571e19b8fff9523f4de428947a (patch)
tree510c8090855f9539ffa6bec9402145a21279fabf /components/script/script_task.rs
parentec417a84b14c78e9ada08d7d489344a69f0eb09d (diff)
downloadservo-d46db6d7f1f10d571e19b8fff9523f4de428947a.tar.gz
servo-d46db6d7f1f10d571e19b8fff9523f4de428947a.zip
Resume tracing our collections of roots.
The second JS_SetExtraGCRootsTracer call clobbered the first, so trace_collections was no longer being called.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index dbb73117857..7ef0b274167 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -99,12 +99,14 @@ use time::Tm;
thread_local!(pub static STACK_ROOTS: Cell<Option<RootCollectionPtr>> = Cell::new(None));
thread_local!(static SCRIPT_TASK_ROOT: RefCell<Option<*const ScriptTask>> = RefCell::new(None));
-unsafe extern fn trace_script_tasks(tr: *mut JSTracer, _data: *mut libc::c_void) {
+unsafe extern fn trace_rust_roots(tr: *mut JSTracer, _data: *mut libc::c_void) {
SCRIPT_TASK_ROOT.with(|root| {
if let Some(script_task) = *root.borrow() {
(*script_task).trace(tr);
}
});
+
+ trace_collections(tr);
}
/// A document load that is in the process of fetching the requested resource. Contains
@@ -463,7 +465,7 @@ impl ScriptTask {
unsafe {
- JS_SetExtraGCRootsTracer((*js_runtime).ptr, Some(trace_collections), ptr::null_mut());
+ JS_SetExtraGCRootsTracer((*js_runtime).ptr, Some(trace_rust_roots), ptr::null_mut());
}
// Unconstrain the runtime's threshold on nominal heap size, to avoid
// triggering GC too often if operating continuously near an arbitrary
@@ -483,7 +485,6 @@ impl ScriptTask {
js_context.set_logging_error_reporter();
unsafe {
JS_SetGCZeal((*js_context).ptr, 0, JS_DEFAULT_ZEAL_FREQ);
- JS_SetExtraGCRootsTracer((*js_runtime).ptr, Some(trace_script_tasks), ptr::null_mut());
}
// Needed for debug assertions about whether GC is running.