Skip to content

Commit e998236

Browse files
committed
doc: clarify behaviour of node-api adjust function
Refs: nodejs#57351 - based on recent request to update one of the tests Signed-off-by: Michael Dawson <[email protected]>
1 parent b71267e commit e998236

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/api/n-api.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6126,14 +6126,18 @@ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,
61266126
* `[in] env`: The environment that the API is invoked under.
61276127
* `[in] change_in_bytes`: The change in externally allocated memory that is kept
61286128
alive by JavaScript objects.
6129-
* `[out] result`: The adjusted value
6129+
* `[out] result`: The adjusted value. Their is no guarrantee that a request to
6130+
adjust by X bytes will result in an adjusted value being X bytes larger than
6131+
before the request. The runtime is free to adjust in the manner it deems
6132+
most appropriate.
61306133

61316134
Returns `napi_ok` if the API succeeded.
61326135

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
6136+
This function gives the runtime an indication of the amount of externally
6137+
allocated memory that is kept alive by JavaScript objects
6138+
(i.e. a JavaScript object that points to its own memory allocated by a
6139+
native addon). Registering externally allocated memory may, but is not
6140+
guarranteed to, trigger global garbage collections more
61376141
often than it would otherwise.
61386142

61396143
## Promises

0 commit comments

Comments
 (0)