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