pub unsafe extern "system" fn JsSetRuntimeBeforeCollectCallback(
runtime: JsRuntimeHandle,
callbackState: *mut c_void,
beforeCollectCallback: JsBeforeCollectCallback
) -> JsErrorCode
Sets a callback function that is called by the runtime before garbage collection.
The callback is invoked on the current runtime execution thread, therefore execution is
blocked until the callback completes.
The callback can be used by hosts to prepare for garbage collection. For example, by
releasing unnecessary references on Chakra objects.
The runtime for which to register the allocation callback.
User provided state that will be passed back to the callback.
The callback function being set.
The code JsNoError if the operation succeeded, a failure code otherwise.