Files
node/doc/api
Gabriel Schulhof 0ac070ccb7 node-api: segregate nogc APIs from rest via type system
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>
2024-03-25 18:13:43 +00:00
..
2023-05-12 11:57:05 +02:00
2023-11-11 20:27:49 +01:00
2023-05-03 08:57:36 +02:00
2023-01-14 14:25:08 +00:00
2023-05-02 09:34:04 +02:00
2024-03-25 18:13:33 +00:00
2023-09-27 23:10:20 -04:00
2024-03-25 18:13:33 +00:00
2024-03-25 17:26:41 +00:00
2023-08-17 08:35:58 -03:00
2024-03-25 18:13:35 +00:00
2023-07-18 13:45:29 -05:00
2022-11-01 04:21:13 +00:00
2023-05-30 11:36:18 +02:00
2023-09-27 23:10:21 -04:00
2024-01-09 08:49:13 +00:00