Commit 4757771
src: add consistency check to node_platform.cc
We use the `Isolate*` pointer as the sole identifier
for a V8 Isolate. In some environments (e.g. multi-threaded),
Isolates may be destroyed and new ones created; then, it
may happen that the memory that was previously used for
one `Isolate` can be re-used for another `Isolate`
after the first one has been disposed of.
This check is a little guard against accidentally
re-using the same per-Isolate platform data structure
in such cases, i.e. making sure (to the degree to which
that is possible) that the old `Isolate*` has been properly
unregistered before one at the same memory address is added.
(It’s not 100 % foolproof because the `uv_loop_t*`
pointer value could theoretically be the same as well.)
PR-URL: #21156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent 79b3423 commit 4757771Copy full SHA for 4757771
File tree
Expand file treeCollapse file tree
2 files changed
+3
-0
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
2 files changed
+3
-0
lines changedOpen diff view settings
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
141 | 141 | |
142 | 142 | |
143 | 143 | |
| 144 | + |
144 | 145 | |
145 | 146 | |
146 | 147 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
72 | 72 | |
73 | 73 | |
74 | 74 | |
| 75 | + |
| 76 | + |
75 | 77 | |
76 | 78 | |
77 | 79 | |
|
0 commit comments