mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 09:08:46 +00:00
![]() We define a new type called `node_api_nogc_env` as the `const` version of `napi_env` and `node_api_nogc_finalize` as a variant of `napi_finalize` that accepts a `node_api_nogc_env` as its first argument. We then modify those APIs which do not affect GC state as accepting a `node_api_nogc_env`. APIs accepting finalizer callbacks are modified to accept `node_api_nogc_finalize` callbacks. Thus, the only way to attach a `napi_finalize` callback, wherein Node-APIs affecting GC state may be called is to call `node_api_post_finalizer` from a `node_api_nogc_finalize` callback. In keeping with the process of introducing new Node-APIs, this feature is guarded by `NAPI_EXPERIMENTAL`. Since this feature modifies APIs already marked as stable, it is additionally guared by `NODE_API_EXPERIMENTAL_NOGC_ENV`, so as to provide a further buffer to adoption. Nevertheless, both guards must be removed upon releasing a new version of Node-API. PR-URL: https://github.com/nodejs/node/pull/50060 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Michael Dawson <midawson@redhat.com> |
||
---|---|---|
.. | ||
2_function_arguments | ||
3_callbacks | ||
4_object_factory | ||
5_function_factory | ||
6_object_wrap | ||
7_factory_wrap | ||
8_passing_wrapped | ||
test_array | ||
test_bigint | ||
test_cannot_run_js | ||
test_constructor | ||
test_conversions | ||
test_dataview | ||
test_date | ||
test_error | ||
test_exception | ||
test_finalizer | ||
test_function | ||
test_general | ||
test_handle_scope | ||
test_instance_data | ||
test_new_target | ||
test_number | ||
test_object | ||
test_promise | ||
test_properties | ||
test_reference | ||
test_reference_double_free | ||
test_string | ||
test_symbol | ||
test_typedarray | ||
.gitignore | ||
common-inl.h | ||
common.h | ||
entry_point.h | ||
testcfg.py |