Skip to content
Snippets Groups Projects
Commit 60ff1a24 authored by deuce's avatar deuce
Browse files

From the JSAPI docs "The recommended technique in SpiderMonkey 1.8 and later

is to periodically call JS_YieldRequest from an operation callback."
parent 24fa45b9
Branches
Tags
No related merge requests found
......@@ -240,6 +240,9 @@ js_CommonOperationCallback(JSContext *cx, js_callback_t* cb)
JS_RESUMEREQUEST(cx, rc);
}
/* Permit other contexts to run GC */
JS_YieldRequest(cx);
/* Periodic Garbage Collection */
if(cb->gc_interval && (cb->counter%cb->gc_interval)==0)
JS_MaybeGC(cx), cb->gc_attempts++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment