Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

JsSetRuntimeBeforeCollectCallback

Limin Zhu edited this page Oct 9, 2015 · 1 revision

Sets a callback function that is called by the runtime before garbage collection.

Syntax

STDAPI_(JsErrorCode)
    JsSetRuntimeBeforeCollectCallback(
    _In_ JsRuntimeHandle runtime,
    _In_opt_ void *callbackState,
    _In_ JsBeforeCollectCallback beforeCollectCallback);

Parameters

  • runtime: The runtime for which to register the allocation callback.
  • callbackState: User provided state that will be passed back to the callback.
  • beforeCollectCallback: The callback function being set.

Return Value

The code JsNoError if the operation succeeded, a failure code otherwise.

Remarks

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.

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.