@@ -477,7 +477,7 @@ napiVersion: 6
477
477
-->
478
478
479
479
```c
480
- napi_status napi_set_instance_data(node_api_nogc_env env,
480
+ napi_status napi_set_instance_data(node_api_basic_env env,
481
481
void* data,
482
482
napi_finalize finalize_cb,
483
483
void* finalize_hint);
@@ -509,7 +509,7 @@ napiVersion: 6
509
509
-->
510
510
511
511
```c
512
- napi_status napi_get_instance_data(node_api_nogc_env env,
512
+ napi_status napi_get_instance_data(node_api_basic_env env,
513
513
void** data);
514
514
```
515
515
@@ -611,16 +611,16 @@ when an instance of a native addon is unloaded. Notification of this event is
611
611
delivered through the callbacks given to [`napi_add_env_cleanup_hook`][] and
612
612
[`napi_set_instance_data`][].
613
613
614
- ### `node_api_nogc_env `
614
+ ### `node_api_basic_env `
615
615
616
616
> Stability: 1 - Experimental
617
617
618
618
This variant of `napi_env` is passed to synchronous finalizers
619
- ([`node_api_nogc_finalize `][]). There is a subset of Node-APIs which accept
620
- a parameter of type `node_api_nogc_env ` as their first argument. These APIs do
619
+ ([`node_api_basic_finalize `][]). There is a subset of Node-APIs which accept
620
+ a parameter of type `node_api_basic_env ` as their first argument. These APIs do
621
621
not access the state of the JavaScript engine and are thus safe to call from
622
622
synchronous finalizers. Passing a parameter of type `napi_env` to these APIs is
623
- allowed, however, passing a parameter of type `node_api_nogc_env ` to APIs that
623
+ allowed, however, passing a parameter of type `node_api_basic_env ` to APIs that
624
624
access the JavaScript engine state is not allowed. Attempting to do so without
625
625
a cast will produce a compiler warning or an error when add-ons are compiled
626
626
with flags which cause them to emit warnings and/or errors when incorrect
@@ -791,7 +791,7 @@ typedef napi_value (*napi_callback)(napi_env, napi_callback_info);
791
791
Unless for reasons discussed in [Object Lifetime Management][], creating a
792
792
handle and/or callback scope inside a `napi_callback` is not necessary.
793
793
794
- #### `node_api_nogc_finalize `
794
+ #### `node_api_basic_finalize `
795
795
796
796
<!-- YAML
797
797
added: v20.12.0
@@ -803,11 +803,11 @@ Function pointer type for add-on provided functions that allow the user to be
803
803
notified when externally-owned data is ready to be cleaned up because the
804
804
object it was associated with has been garbage-collected. The user must provide
805
805
a function satisfying the following signature which would get called upon the
806
- object's collection. Currently, `node_api_nogc_finalize ` can be used for
806
+ object's collection. Currently, `node_api_basic_finalize ` can be used for
807
807
finding out when objects that have external data are collected.
808
808
809
809
```c
810
- typedef void (*node_api_nogc_finalize)(node_api_nogc_env env,
810
+ typedef void (*node_api_basic_finalize)(node_api_basic_env env,
811
811
void* finalize_data,
812
812
void* finalize_hint);
813
813
```
@@ -817,7 +817,7 @@ handle and/or callback scope inside the function body is not necessary.
817
817
818
818
Since these functions may be called while the JavaScript engine is in a state
819
819
where it cannot execute JavaScript code, only Node-APIs which accept a
820
- `node_api_nogc_env ` as their first parameter may be called.
820
+ `node_api_basic_env ` as their first parameter may be called.
821
821
[`node_api_post_finalizer`][] can be used to schedule Node-API calls that
822
822
require access to the JavaScript engine's state to run after the current
823
823
garbage collection cycle has completed.
@@ -831,10 +831,10 @@ Change History:
831
831
832
832
* experimental (`NAPI_EXPERIMENTAL`):
833
833
834
- Only Node-API calls that accept a `node_api_nogc_env ` as their first
834
+ Only Node-API calls that accept a `node_api_basic_env ` as their first
835
835
parameter may be called, otherwise the application will be terminated with an
836
836
appropriate error message. This feature can be turned off by defining
837
- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
837
+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
838
838
839
839
#### `napi_finalize`
840
840
@@ -859,9 +859,9 @@ Change History:
859
859
* experimental (`NAPI_EXPERIMENTAL` is defined):
860
860
861
861
A function of this type may no longer be used as a finalizer, except with
862
- [`node_api_post_finalizer`][]. [`node_api_nogc_finalize `][] must be used
862
+ [`node_api_post_finalizer`][]. [`node_api_basic_finalize `][] must be used
863
863
instead. This feature can be turned off by defining
864
- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
864
+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
865
865
866
866
#### `napi_async_execute_callback`
867
867
@@ -1063,7 +1063,7 @@ napiVersion: 1
1063
1063
1064
1064
```c
1065
1065
napi_status
1066
- napi_get_last_error_info(node_api_nogc_env env,
1066
+ napi_get_last_error_info(node_api_basic_env env,
1067
1067
const napi_extended_error_info** result);
1068
1068
```
1069
1069
@@ -1882,7 +1882,7 @@ napiVersion: 3
1882
1882
-->
1883
1883
1884
1884
```c
1885
- NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_nogc_env env,
1885
+ NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_basic_env env,
1886
1886
napi_cleanup_hook fun,
1887
1887
void* arg);
1888
1888
```
@@ -1912,7 +1912,7 @@ napiVersion: 3
1912
1912
-->
1913
1913
1914
1914
```c
1915
- NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_nogc_env env,
1915
+ NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_basic_env env,
1916
1916
void (*fun)(void* arg),
1917
1917
void* arg);
1918
1918
```
@@ -1941,7 +1941,7 @@ changes:
1941
1941
1942
1942
```c
1943
1943
NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
1944
- node_api_nogc_env env,
1944
+ node_api_basic_env env,
1945
1945
napi_async_cleanup_hook hook,
1946
1946
void* arg,
1947
1947
napi_async_cleanup_hook_handle* remove_handle);
@@ -5524,7 +5524,7 @@ napiVersion: 5
5524
5524
napi_status napi_add_finalizer(napi_env env,
5525
5525
napi_value js_object,
5526
5526
void* finalize_data,
5527
- node_api_nogc_finalize finalize_cb,
5527
+ node_api_basic_finalize finalize_cb,
5528
5528
void* finalize_hint,
5529
5529
napi_ref* result);
5530
5530
```
@@ -5562,7 +5562,7 @@ added: v20.10.0
5562
5562
> Stability: 1 - Experimental
5563
5563
5564
5564
```c
5565
- napi_status node_api_post_finalizer(node_api_nogc_env env,
5565
+ napi_status node_api_post_finalizer(node_api_basic_env env,
5566
5566
napi_finalize finalize_cb,
5567
5567
void* finalize_data,
5568
5568
void* finalize_hint);
@@ -5632,7 +5632,7 @@ Once created the async worker can be queued
5632
5632
for execution using the [`napi_queue_async_work`][] function:
5633
5633
5634
5634
```c
5635
- napi_status napi_queue_async_work(node_api_nogc_env env,
5635
+ napi_status napi_queue_async_work(node_api_basic_env env,
5636
5636
napi_async_work work);
5637
5637
```
5638
5638
@@ -5724,7 +5724,7 @@ napiVersion: 1
5724
5724
-->
5725
5725
5726
5726
```c
5727
- napi_status napi_queue_async_work(node_api_nogc_env env,
5727
+ napi_status napi_queue_async_work(node_api_basic_env env,
5728
5728
napi_async_work work);
5729
5729
```
5730
5730
@@ -5745,7 +5745,7 @@ napiVersion: 1
5745
5745
-->
5746
5746
5747
5747
```c
5748
- napi_status napi_cancel_async_work(node_api_nogc_env env,
5748
+ napi_status napi_cancel_async_work(node_api_basic_env env,
5749
5749
napi_async_work work);
5750
5750
```
5751
5751
@@ -5949,7 +5949,7 @@ typedef struct {
5949
5949
const char* release;
5950
5950
} napi_node_version;
5951
5951
5952
- napi_status napi_get_node_version(node_api_nogc_env env,
5952
+ napi_status napi_get_node_version(node_api_basic_env env,
5953
5953
const napi_node_version** version);
5954
5954
```
5955
5955
@@ -5972,7 +5972,7 @@ napiVersion: 1
5972
5972
-->
5973
5973
5974
5974
```c
5975
- napi_status napi_get_version(node_api_nogc_env env,
5975
+ napi_status napi_get_version(node_api_basic_env env,
5976
5976
uint32_t* result);
5977
5977
```
5978
5978
@@ -6005,7 +6005,7 @@ napiVersion: 1
6005
6005
-->
6006
6006
6007
6007
```c
6008
- NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_nogc_env env,
6008
+ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
6009
6009
int64_t change_in_bytes,
6010
6010
int64_t* result);
6011
6011
```
@@ -6222,7 +6222,7 @@ napiVersion: 2
6222
6222
-->
6223
6223
6224
6224
```c
6225
- NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env,
6225
+ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,
6226
6226
struct uv_loop_s** loop);
6227
6227
```
6228
6228
@@ -6542,7 +6542,7 @@ napiVersion: 4
6542
6542
6543
6543
```c
6544
6544
NAPI_EXTERN napi_status
6545
- napi_ref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6545
+ napi_ref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
6546
6546
```
6547
6547
6548
6548
* `[in] env`: The environment that the API is invoked under.
@@ -6568,7 +6568,7 @@ napiVersion: 4
6568
6568
6569
6569
```c
6570
6570
NAPI_EXTERN napi_status
6571
- napi_unref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6571
+ napi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
6572
6572
```
6573
6573
6574
6574
* `[in] env`: The environment that the API is invoked under.
@@ -6594,7 +6594,7 @@ napiVersion: 9
6594
6594
6595
6595
```c
6596
6596
NAPI_EXTERN napi_status
6597
- node_api_get_module_file_name(node_api_nogc_env env, const char** result);
6597
+ node_api_get_module_file_name(node_api_basic_env env, const char** result);
6598
6598
6599
6599
```
6600
6600
@@ -6719,10 +6719,10 @@ the add-on's file name during loading.
6719
6719
[`napi_wrap`]: #napi_wrap
6720
6720
[`node-addon-api`]: https://github.com/nodejs/node-addon-api
6721
6721
[`node_api.h`]: https://github.com/nodejs/node/blob/HEAD/src/node_api.h
6722
+ [`node_api_basic_finalize`]: #node_api_basic_finalize
6722
6723
[`node_api_create_external_string_latin1`]: #node_api_create_external_string_latin1
6723
6724
[`node_api_create_external_string_utf16`]: #node_api_create_external_string_utf16
6724
6725
[`node_api_create_syntax_error`]: #node_api_create_syntax_error
6725
- [`node_api_nogc_finalize`]: #node_api_nogc_finalize
6726
6726
[`node_api_post_finalizer`]: #node_api_post_finalizer
6727
6727
[`node_api_throw_syntax_error`]: #node_api_throw_syntax_error
6728
6728
[`process.release`]: process.md#processrelease
0 commit comments