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

Unified Diff: src/profile-generator.cc

Issue 3096008: A follow-up to r5211: fix a couple of issues detected on Windows. (Closed)
Patch Set: Created 10 years, 4 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/profile-generator.h ('K') | « src/profile-generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index 01c4e4fe8709a2eb4e1030bba3d828c7d9c4e7d6..7653c095697ea04a0af1cb8a4b298abd70a75ba0 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -1465,6 +1465,7 @@ uint64_t HeapObjectsMap::FindEntry(Address addr) {
void HeapObjectsMap::RemoveDeadEntries() {
List<EntryInfo>* new_entries = new List<EntryInfo>();
+ List<void*> dead_entries;
for (HashMap::Entry* entry = entries_map_.Start();
entry != NULL;
entry = entries_map_.Next(entry)) {
@@ -1474,8 +1475,15 @@ void HeapObjectsMap::RemoveDeadEntries() {
if (entry_info.accessed) {
entry->value = reinterpret_cast<void*>(new_entries->length());
new_entries->Add(EntryInfo(entry_info.id, false));
+ } else {
+ dead_entries.Add(entry->key);
}
}
+ for (int i = 0; i < dead_entries.length(); ++i) {
+ void* raw_entry = dead_entries[i];
+ entries_map_.Remove(
+ raw_entry, AddressHash(reinterpret_cast<Address>(raw_entry)));
+ }
delete entries_;
entries_ = new_entries;
}
« src/profile-generator.h ('K') | « src/profile-generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698