Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

JsSetRuntimeMemoryAllocationCallback

Limin Zhu edited this pageOct 9, 2015 ·1 revision

Sets a memory allocation callback for specified runtime

Syntax

STDAPI_(JsErrorCode)    JsSetRuntimeMemoryAllocationCallback(    _In_ JsRuntimeHandle runtime,    _In_opt_ void *callbackState,    _In_ JsMemoryAllocationCallback allocationCallback);

Parameters

  • runtime: The runtime for which to register the allocation callback.
  • callbackState: User provided state that will be passed back to the callback.
  • allocationCallback: Memory allocation callback to be called for memory allocation events.

Return Value

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

Remarks

Registering a memory allocation callback will cause the runtime to call back to the hostwhenever it acquires memory from, or releases memory to, the OS. The callback routine iscalled before the runtime memory manager allocates a block of memory. The allocation willbe rejected if the callback returns false. The runtime memory manager will also invoke thecallback routine after freeing a block of memory, as well as after allocation failures.The callback is invoked on the current runtime execution thread, therefore execution isblocked until the callback completes.The return value of the callback is not stored; previously rejected allocations will notprevent the runtime from invoking the callback again later for new memory allocations.

Want to contribute to this Wiki?

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp