@@ -6126,16 +6126,25 @@ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
6126
6126
* `[in] env`: The environment that the API is invoked under.
6127
6127
* `[in] change_in_bytes`: The change in externally allocated memory that is kept
6128
6128
alive by JavaScript objects.
6129
- * `[out] result`: The adjusted value
6129
+ * `[out] result`: The adjusted value. This value should reflect the
6130
+ total amount of external memory with the given `change_in_bytes` included.
6131
+ The absolute value of the returned value should not be depended on.
6132
+ For example, implementations may use a single counter for all addons, or a
6133
+ counter for each addon.
6130
6134
6131
6135
Returns `napi_ok` if the API succeeded.
6132
6136
6133
- This function gives V8 an indication of the amount of externally allocated
6134
- memory that is kept alive by JavaScript objects (i.e. a JavaScript object
6135
- that points to its own memory allocated by a native addon). Registering
6136
- externally allocated memory will trigger global garbage collections more
6137
+ This function gives the runtime an indication of the amount of externally
6138
+ allocated memory that is kept alive by JavaScript objects
6139
+ (i.e. a JavaScript object that points to its own memory allocated by a
6140
+ native addon). Registering externally allocated memory may, but is not
6141
+ guaranteed to, trigger global garbage collections more
6137
6142
often than it would otherwise.
6138
6143
6144
+ This function is expected to be called in a manner such that an
6145
+ addon does not decrease the external memory more than it has
6146
+ increased the external memory.
6147
+
6139
6148
## Promises
6140
6149
6141
6150
Node-API provides facilities for creating `Promise` objects as described in
0 commit comments