Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: src/heap-snapshot-generator.cc

Issue 13786002: [WIP] New GC related APIs. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: fixed Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index fb239aa3cf6dd82cc04af83c7be2afdcac8ac470..d073a8d1c2212e7ac2303dd6bcafa706b52da12a 100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1943,15 +1943,19 @@ void NativeObjectsExplorer::FillRetainedObjects() {
List<ObjectGroup*>* groups = isolate->global_handles()->object_groups();
for (int i = 0; i < groups->length(); ++i) {
ObjectGroup* group = groups->at(i);
- if (group->info_ == NULL) continue;
- List<HeapObject*>* list = GetListMaybeDisposeInfo(group->info_);
- for (size_t j = 0; j < group->length_; ++j) {
- HeapObject* obj = HeapObject::cast(*group->objects_[j]);
+ if (group->info == NULL) {
+ delete group;
+ continue;
+ }
+ List<HeapObject*>* list = GetListMaybeDisposeInfo(group->info);
+ for (int j = 0; j < group->objects.length(); ++j) {
+ HeapObject* obj = HeapObject::cast(*group->objects[j]);
list->Add(obj);
in_groups_.Insert(obj);
}
- group->info_ = NULL; // Acquire info object ownership.
+ delete group;
}
+ delete groups;
isolate->global_handles()->RemoveObjectGroups();
isolate->heap()->CallGCEpilogueCallbacks(major_gc_type);
// Record objects that are not in ObjectGroups, but have class ID.
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698