Search completed in 1.25 seconds.
2 results for "jsoperationcallback":
JS_MaybeGC
Mozilla › Projects › SpiderMonkey › JSAPI reference › JS MaybeGC
beGC tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take. If so, it performs some garbage collection. Calling JS_MaybeGC when the application is idle can help prevent garbage collection from happening at less convenient times. Calling JS_MaybeGC periodically when the application is busy, from a JSBranchCallback or JSOperationCallback Added in SpiderMonkey 1.8, can keep memory usage down and improve performance. Both are good practices. In both cases, frequent calls JS_MaybeGC are safe and will not cause the application to spend a lot of time doing redundant garbage collection work. Implementation note: SpiderMonkey 1.8 and earlier determine whether garbage collection is appropriate by analyzing statistics about the GC heap a...
JS_SetOperationCallback
Mozilla › Projects › SpiderMonkey › JSAPI reference › JS SetOperationCallback
Try to avoid using it. This article covers features introduced in SpiderMonkey 1.8.5 Set a callback function that is automatically called periodically while JavaScript code runs. These methods/types are renamed to JS_SetInterruptCallback, JS_GetInterruptCallback, JS_RequestInterruptCallback and JSInterruptCallback in SpiderMonkey 30. Syntax void JS_SetOperationCallback(JSContext *cx, JSOperationCallback callback); JSOperationCallback JS_GetOperationCallback(JSContext *cx); void JS_TriggerOperationCallback(JSRuntime *rt); Name Type Description cx JSContext * A context. rt JSRuntime * The runtime. callback JSOperationCallback (only in JS_SetOperationCallback) The callback function to install. Callback syntax JSBool (*JSOperati...