Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ed5845

Browse filesBrowse files
isurusiritargos
authored andcommitted
doc: explain how to invoke gc
Currently the documentation for Wrapping C++ Objects doesn't explain how to destruct an object by explicitly invoking the garbage collector. This commit includes a modification to docs that explains how to force the garbage collector to clear objects using V8's command line flags. Fixes: #19876 PR-URL: #20431 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org>
1 parent 6367349 commit 6ed5845
Copy full SHA for 6ed5845

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/addons.md‎

Copy file name to clipboardExpand all lines: doc/api/addons.md
+7Lines changed: 7 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,13 @@ console.log(obj.plusOne());
848848
// Prints: 13
849849
```
850850

851+
The destructor for a wrapper object will run when the object is
852+
garbage-collected. For destructor testing, there are command-line flags that
853+
can be used to make it possible to force garbage collection. These flags are
854+
provided by the underlying V8 JavaScript engine. They are subject to change
855+
or removal at any time. They are not documented by Node.js or V8, and they
856+
should never be used outside of testing.
857+
851858
### Factory of wrapped objects
852859

853860
Alternatively, it is possible to use a factory pattern to avoid explicitly

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.