Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-18 01:45:14 +0300
committerAnna Henningsen <anna@addaleax.net>2019-02-22 23:42:09 +0300
commit8ebd339031cf9826629ad780dd35fee130e95985 (patch)
tree6a8a1b59040f55404e3cb3e3cf2860bd4879bd40 /doc/api/addons.md
parent455b927be0111a6aa8f1e30ae5b21659afeba40d (diff)
worker: improve integration with native addons
Allow loading add-ons from multiple Node.js instances if they are declared context-aware; in particular, this applies to N-API addons. Also, plug a memory leak that occurred when registering N-API addons. Refs: https://github.com/nodejs/node/pull/23319 PR-URL: https://github.com/nodejs/node/pull/26175 Fixes: https://github.com/nodejs/node/issues/21481 Fixes: https://github.com/nodejs/node/issues/21783 Fixes: https://github.com/nodejs/node/issues/25662 Fixes: https://github.com/nodejs/node/issues/20239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'doc/api/addons.md')
-rw-r--r--doc/api/addons.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/api/addons.md b/doc/api/addons.md
index 4941d3de9ad..1c811b50c21 100644
--- a/doc/api/addons.md
+++ b/doc/api/addons.md
@@ -251,6 +251,11 @@ down. If necessary, such hooks can be removed using
`RemoveEnvironmentCleanupHook()` before they are run, which has the same
signature.
+In order to be loaded from multiple Node.js environments,
+such as a main thread and a Worker thread, an add-on needs to either:
+- Be an N-API addon, or
+- Be declared as context-aware using `NODE_MODULE_INIT()` as described above
+
### Building
Once the source code has been written, it must be compiled into the binary