node_api_create_external_sharedarraybuffer
functionjs_native_api.hCreate a SharedArrayBuffer with externally managed memory.
napi_status
node_api_create_external_sharedarraybuffer(napi_env env,
void* external_data,
size_t byte_length,
node_api_noenv_finalize finalize_cb,
void* finalize_hint,
napi_value* result)
[in] env: The environment that the API is invoked under.[in] external_data: Pointer to the underlying byte buffer of theSharedArrayBuffer.[in] byte_length: The length in bytes of the underlying buffer.[in] finalize_cb: Optional callback to call when theSharedArrayBufferis being collected. Called on an arbitrary thread. Because aSharedArrayBuffercan outlive the environment it's created in, the callback does not receive a reference toenv.[in] finalize_hint: Optional hint to pass to the finalize callback during collection.[out] result: Anapi_valuerepresenting a JavaScriptSharedArrayBuffer.
Returns napi_ok if the API succeeded.
Create a SharedArrayBuffer with externally managed memory.
See the entry on napi_create_external_arraybuffer for runtime
compatibility.