mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Correct the call to JS_SetGCZeal.
This commit is contained in:
parent
5a61142720
commit
decc57f2ad
1 changed files with 4 additions and 4 deletions
|
@ -120,7 +120,7 @@ pub unsafe fn new_rt_and_cx() -> Runtime {
|
|||
// Pre barriers aren't working correctly at the moment
|
||||
DisableIncrementalGC(runtime.rt());
|
||||
|
||||
set_gc_zeal_options(runtime.cx());
|
||||
set_gc_zeal_options(runtime.rt());
|
||||
|
||||
// Enable or disable the JITs.
|
||||
let rt_opts = &mut *RuntimeOptionsRef(runtime.rt());
|
||||
|
@ -400,7 +400,7 @@ unsafe extern fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_void
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
#[cfg(feature = "debugmozjs")]
|
||||
unsafe fn set_gc_zeal_options(cx: *mut JSContext) {
|
||||
unsafe fn set_gc_zeal_options(rt: *mut JSRuntime) {
|
||||
use js::jsapi::{JS_DEFAULT_ZEAL_FREQ, JS_SetGCZeal};
|
||||
|
||||
let level = match PREFS.get("js.mem.gc.zeal.level").as_i64() {
|
||||
|
@ -411,9 +411,9 @@ unsafe fn set_gc_zeal_options(cx: *mut JSContext) {
|
|||
Some(frequency) if frequency >= 0 => frequency as u32,
|
||||
_ => JS_DEFAULT_ZEAL_FREQ,
|
||||
};
|
||||
JS_SetGCZeal(cx, level, frequency);
|
||||
JS_SetGCZeal(rt, level, frequency);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
#[cfg(not(feature = "debugmozjs"))]
|
||||
unsafe fn set_gc_zeal_options(_: *mut JSContext) {}
|
||||
unsafe fn set_gc_zeal_options(_: *mut JSRuntime) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue