src: annotate BaseObjects in the heap snapshots correctly · nodejs/node@cfb39b9 · GitHub
Skip to content

Commit cfb39b9

Browse files
joyeecheungRafaelGSS
authored andcommitted
src: annotate BaseObjects in the heap snapshots correctly
This fixes two issues in the BaseObject views in the heap snapshots: 1. BaseObjects are not conceptually roots when the environment and the realms are also showing up in the heap snapshot. Rather, they should be considered being held alive by the BaseObjectList in the realms, which are in turn held alive by Environment. The actual root from the containment view should be the Environment instead. 2. The concept of DOM detaching does not really apply to Node.js wrappers, and it's confusing to connect that with the weakness or detachment (native weakness) of BaseObjects. To avoid the confusion, just restore to the default detachedness for them. PR-URL: #57417 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 3457aee commit cfb39b9

3 files changed

Lines changed: 0 additions & 12 deletions

File tree

src/base_object-inl.h

Lines changed: 0 additions & 5 deletions

src/base_object.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@ Local<Object> BaseObject::WrappedObject() const {
161161
return object();
162162
}
163163

164-
bool BaseObject::IsRootNode() const {
165-
return !persistent_handle_.IsWeak();
166-
}
167-
168164
bool BaseObject::IsNotIndicativeOfMemoryLeakAtExit() const {
169165
return IsWeakOrDetached();
170166
}

src/base_object.h

Lines changed: 0 additions & 3 deletions

0 commit comments

Comments
 (0)