Skip to content

Commit 1d60b7e

Browse files
gireeshpunathilruyadorno
authored andcommitted
doc: improve c++ embedder API doc
normalise the headers, fixup bullet points and expand `node::IsolateData` scope for clarity. PR-URL: #55597 Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent acbb629 commit 1d60b7e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

doc/api/embedding.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ a Node.js-specific environment.
2323

2424
The full code can be found [in the Node.js source tree][embedtest.cc].
2525

26-
### Setting up per-process state
26+
### Setting up a per-process state
2727

2828
Node.js requires some per-process state management in order to run:
2929

@@ -72,7 +72,7 @@ int main(int argc, char** argv) {
7272
}
7373
```
7474
75-
### Per-instance state
75+
### Setting up a per-instance state
7676
7777
<!-- YAML
7878
changes:
@@ -86,11 +86,12 @@ Node.js has a concept of a “Node.js instance”, that is commonly being referr
8686
to as `node::Environment`. Each `node::Environment` is associated with:
8787
8888
* Exactly one `v8::Isolate`, i.e. one JS Engine instance,
89-
* Exactly one `uv_loop_t`, i.e. one event loop, and
90-
* A number of `v8::Context`s, but exactly one main `v8::Context`.
89+
* Exactly one `uv_loop_t`, i.e. one event loop,
90+
* A number of `v8::Context`s, but exactly one main `v8::Context`, and
9191
* One `node::IsolateData` instance that contains information that could be
92-
shared by multiple `node::Environment`s that use the same `v8::Isolate`.
93-
Currently, no testing is performed for this scenario.
92+
shared by multiple `node::Environment`s. The embedder should make sure
93+
that `node::IsolateData` is shared only among `node::Environment`s that
94+
use the same `v8::Isolate`, Node.js does not perform this check.
9495
9596
In order to set up a `v8::Isolate`, an `v8::ArrayBuffer::Allocator` needs
9697
to be provided. One possible choice is the default Node.js allocator, which

0 commit comments

Comments
 (0)