-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
doc: clarify behaviour of node-api adjust function #57463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
e998236
0fcc85e
53d4bf0
f982c65
2425f8e
3ca64c0
d4da3bf
d7aec7a
0e3379e
d8cdc40
3753184
5176d7d
a201240
0792c64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6126,16 +6126,24 @@ NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env, | |
* `[in] env`: The environment that the API is invoked under. | ||
* `[in] change_in_bytes`: The change in externally allocated memory that is kept | ||
alive by JavaScript objects. | ||
* `[out] result`: The adjusted value | ||
* `[out] result`: The adjusted value. This value should reflect the relative | ||
total amount changed with the given `change_in_bytes` of accounted external | ||
memory size. Implementations may use a single counter for all addons, or a | ||
counter for each addon. The absolute value of the returned value should not | ||
be depended on. | ||
|
||
Returns `napi_ok` if the API succeeded. | ||
|
||
This function gives V8 an indication of the amount of externally allocated | ||
memory that is kept alive by JavaScript objects (i.e. a JavaScript object | ||
that points to its own memory allocated by a native addon). Registering | ||
externally allocated memory will trigger global garbage collections more | ||
This function gives the runtime an indication of the amount of externally | ||
allocated memory that is kept alive by JavaScript objects | ||
(i.e. a JavaScript object that points to its own memory allocated by a | ||
native addon). Registering externally allocated memory may, but is not | ||
guaranteed to, trigger global garbage collections more | ||
often than it would otherwise. | ||
mhdawson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This function is expected to be invoked symmetrically. If it is invoked with +512KB, | ||
mhdawson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
it is expected to be invoked -512KB in sum at a later time. | ||
|
||
|
||
## Promises | ||
|
||
Node-API provides facilities for creating `Promise` objects as described in | ||
|
Uh oh!
There was an error while loading. Please reload this page.