aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-04-17 17:03:21 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:31 -0400
commit8e10daba979a7a30b69ffd66dd4f3b256c39b615 (patch)
tree8c5d6569bdfbac6a1424d8415b51f92af48b1a79 /src
parent109410900c75721a77b970be3bdd830968e47151 (diff)
downloadservo-8e10daba979a7a30b69ffd66dd4f3b256c39b615.tar.gz
servo-8e10daba979a7a30b69ffd66dd4f3b256c39b615.zip
Allow controlling GC zeal via JS_GC_ZEAL environment variable.
Diffstat (limited to 'src')
-rw-r--r--src/components/script/script_task.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index d82dace6d99..e319ef18837 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -36,7 +36,7 @@ use geom::point::Point2D;
use geom::size::Size2D;
use js::global::DEBUG_FNS;
use js::jsapi::{JSObject, JS_CallFunctionValue, JS_DefineFunctions};
-use js::jsapi::JS_SetWrapObjectCallbacks;
+use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_DEFAULT_ZEAL_FREQ};
use js::jsval::NullValue;
use js::rust::{Cx, RtUtils};
use js;
@@ -432,6 +432,10 @@ impl Page {
// Note that the order that these variables are initialized is _not_ arbitrary. Switching
// them around can -- and likely will -- lead to things breaking.
+ unsafe {
+ JS_SetGCZeal(js_context.deref().ptr, 0, JS_DEFAULT_ZEAL_FREQ);
+ }
+
js_context.set_default_options_and_version();
js_context.set_logging_error_reporter();