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

Unified Diff: content/common/discardable_shared_memory_heap.cc

Issue 947743002: content: Fix problem with implementation of MergeIntoFreeList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | content/common/discardable_shared_memory_heap_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/discardable_shared_memory_heap.cc
diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc
index fc97c2bd186e16d219a48b6693e0bbc6b5d3ba73..c854a96b042d86192c93d5aa9a6ce053005771ce 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -75,7 +75,8 @@ void DiscardableSharedMemoryHeap::MergeIntoFreeList(scoped_ptr<Span> span) {
scoped_ptr<Span> prev = RemoveFromFreeList(prev_it->second);
DCHECK_EQ(prev->start_ + prev->length_, span->start_);
UnregisterSpan(prev.get());
- spans_.erase(span->start_);
+ if (span->length_ > 1)
+ spans_.erase(span->start_);
span->start_ -= prev->length_;
span->length_ += prev->length_;
spans_[span->start_] = span.get();
« no previous file with comments | « no previous file | content/common/discardable_shared_memory_heap_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698