@@ -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:
@@ -806,11 +806,11 @@ Function pointer type for add-on provided functions that allow the user to be
806
806
notified when externally-owned data is ready to be cleaned up because the
807
807
object it was associated with has been garbage-collected. The user must provide
808
808
a function satisfying the following signature which would get called upon the
809
- object's collection. Currently, `node_api_nogc_finalize ` can be used for
809
+ object's collection. Currently, `node_api_basic_finalize ` can be used for
810
810
finding out when objects that have external data are collected.
811
811
812
812
```c
813
- typedef void (*node_api_nogc_finalize)(node_api_nogc_env env,
813
+ typedef void (*node_api_basic_finalize)(node_api_basic_env env,
814
814
void* finalize_data,
815
815
void* finalize_hint);
816
816
```
@@ -820,7 +820,7 @@ handle and/or callback scope inside the function body is not necessary.
820
820
821
821
Since these functions may be called while the JavaScript engine is in a state
822
822
where it cannot execute JavaScript code, only Node-APIs which accept a
823
- `node_api_nogc_env ` as their first parameter may be called.
823
+ `node_api_basic_env ` as their first parameter may be called.
824
824
[`node_api_post_finalizer`][] can be used to schedule Node-API calls that
825
825
require access to the JavaScript engine's state to run after the current
826
826
garbage collection cycle has completed.
@@ -834,10 +834,10 @@ Change History:
834
834
835
835
* experimental (`NAPI_EXPERIMENTAL`):
836
836
837
- Only Node-API calls that accept a `node_api_nogc_env ` as their first
837
+ Only Node-API calls that accept a `node_api_basic_env ` as their first
838
838
parameter may be called, otherwise the application will be terminated with an
839
839
appropriate error message. This feature can be turned off by defining
840
- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
840
+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
841
841
842
842
#### `napi_finalize`
843
843
@@ -862,9 +862,9 @@ Change History:
862
862
* experimental (`NAPI_EXPERIMENTAL` is defined):
863
863
864
864
A function of this type may no longer be used as a finalizer, except with
865
- [`node_api_post_finalizer`][]. [`node_api_nogc_finalize `][] must be used
865
+ [`node_api_post_finalizer`][]. [`node_api_basic_finalize `][] must be used
866
866
instead. This feature can be turned off by defining
867
- `NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT `.
867
+ `NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT `.
868
868
869
869
#### `napi_async_execute_callback`
870
870
@@ -1066,7 +1066,7 @@ napiVersion: 1
1066
1066
1067
1067
```c
1068
1068
napi_status
1069
- napi_get_last_error_info(node_api_nogc_env env,
1069
+ napi_get_last_error_info(node_api_basic_env env,
1070
1070
const napi_extended_error_info** result);
1071
1071
```
1072
1072
@@ -1885,7 +1885,7 @@ napiVersion: 3
1885
1885
-->
1886
1886
1887
1887
```c
1888
- NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_nogc_env env,
1888
+ NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_basic_env env,
1889
1889
napi_cleanup_hook fun,
1890
1890
void* arg);
1891
1891
```
@@ -1915,7 +1915,7 @@ napiVersion: 3
1915
1915
-->
1916
1916
1917
1917
```c
1918
- NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_nogc_env env,
1918
+ NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_basic_env env,
1919
1919
void (*fun)(void* arg),
1920
1920
void* arg);
1921
1921
```
@@ -1944,7 +1944,7 @@ changes:
1944
1944
1945
1945
```c
1946
1946
NAPI_EXTERN napi_status napi_add_async_cleanup_hook(
1947
- node_api_nogc_env env,
1947
+ node_api_basic_env env,
1948
1948
napi_async_cleanup_hook hook,
1949
1949
void* arg,
1950
1950
napi_async_cleanup_hook_handle* remove_handle);
@@ -5533,7 +5533,7 @@ napiVersion: 5
5533
5533
napi_status napi_add_finalizer(napi_env env,
5534
5534
napi_value js_object,
5535
5535
void* finalize_data,
5536
- node_api_nogc_finalize finalize_cb,
5536
+ node_api_basic_finalize finalize_cb,
5537
5537
void* finalize_hint,
5538
5538
napi_ref* result);
5539
5539
```
@@ -5574,7 +5574,7 @@ added:
5574
5574
> Stability: 1 - Experimental
5575
5575
5576
5576
```c
5577
- napi_status node_api_post_finalizer(node_api_nogc_env env,
5577
+ napi_status node_api_post_finalizer(node_api_basic_env env,
5578
5578
napi_finalize finalize_cb,
5579
5579
void* finalize_data,
5580
5580
void* finalize_hint);
@@ -5644,7 +5644,7 @@ Once created the async worker can be queued
5644
5644
for execution using the [`napi_queue_async_work`][] function:
5645
5645
5646
5646
```c
5647
- napi_status napi_queue_async_work(node_api_nogc_env env,
5647
+ napi_status napi_queue_async_work(node_api_basic_env env,
5648
5648
napi_async_work work);
5649
5649
```
5650
5650
@@ -5736,7 +5736,7 @@ napiVersion: 1
5736
5736
-->
5737
5737
5738
5738
```c
5739
- napi_status napi_queue_async_work(node_api_nogc_env env,
5739
+ napi_status napi_queue_async_work(node_api_basic_env env,
5740
5740
napi_async_work work);
5741
5741
```
5742
5742
@@ -5757,7 +5757,7 @@ napiVersion: 1
5757
5757
-->
5758
5758
5759
5759
```c
5760
- napi_status napi_cancel_async_work(node_api_nogc_env env,
5760
+ napi_status napi_cancel_async_work(node_api_basic_env env,
5761
5761
napi_async_work work);
5762
5762
```
5763
5763
@@ -5961,7 +5961,7 @@ typedef struct {
5961
5961
const char* release;
5962
5962
} napi_node_version;
5963
5963
5964
- napi_status napi_get_node_version(node_api_nogc_env env,
5964
+ napi_status napi_get_node_version(node_api_basic_env env,
5965
5965
const napi_node_version** version);
5966
5966
```
5967
5967
@@ -5984,7 +5984,7 @@ napiVersion: 1
5984
5984
-->
5985
5985
5986
5986
```c
5987
- napi_status napi_get_version(node_api_nogc_env env,
5987
+ napi_status napi_get_version(node_api_basic_env env,
5988
5988
uint32_t* result);
5989
5989
```
5990
5990
@@ -6017,7 +6017,7 @@ napiVersion: 1
6017
6017
-->
6018
6018
6019
6019
```c
6020
- NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_nogc_env env,
6020
+ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
6021
6021
int64_t change_in_bytes,
6022
6022
int64_t* result);
6023
6023
```
@@ -6234,7 +6234,7 @@ napiVersion: 2
6234
6234
-->
6235
6235
6236
6236
```c
6237
- NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_nogc_env env,
6237
+ NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,
6238
6238
struct uv_loop_s** loop);
6239
6239
```
6240
6240
@@ -6554,7 +6554,7 @@ napiVersion: 4
6554
6554
6555
6555
```c
6556
6556
NAPI_EXTERN napi_status
6557
- napi_ref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6557
+ napi_ref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
6558
6558
```
6559
6559
6560
6560
* `[in] env`: The environment that the API is invoked under.
@@ -6580,7 +6580,7 @@ napiVersion: 4
6580
6580
6581
6581
```c
6582
6582
NAPI_EXTERN napi_status
6583
- napi_unref_threadsafe_function(node_api_nogc_env env, napi_threadsafe_function func);
6583
+ napi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);
6584
6584
```
6585
6585
6586
6586
* `[in] env`: The environment that the API is invoked under.
@@ -6606,7 +6606,7 @@ napiVersion: 9
6606
6606
6607
6607
```c
6608
6608
NAPI_EXTERN napi_status
6609
- node_api_get_module_file_name(node_api_nogc_env env, const char** result);
6609
+ node_api_get_module_file_name(node_api_basic_env env, const char** result);
6610
6610
6611
6611
```
6612
6612
@@ -6731,10 +6731,10 @@ the add-on's file name during loading.
6731
6731
[`napi_wrap`]: #napi_wrap
6732
6732
[`node-addon-api`]: https://github.com/nodejs/node-addon-api
6733
6733
[`node_api.h`]: https://github.com/nodejs/node/blob/HEAD/src/node_api.h
6734
+ [`node_api_basic_finalize`]: #node_api_basic_finalize
6734
6735
[`node_api_create_external_string_latin1`]: #node_api_create_external_string_latin1
6735
6736
[`node_api_create_external_string_utf16`]: #node_api_create_external_string_utf16
6736
6737
[`node_api_create_syntax_error`]: #node_api_create_syntax_error
6737
- [`node_api_nogc_finalize`]: #node_api_nogc_finalize
6738
6738
[`node_api_post_finalizer`]: #node_api_post_finalizer
6739
6739
[`node_api_throw_syntax_error`]: #node_api_throw_syntax_error
6740
6740
[`process.release`]: process.md#processrelease
0 commit comments