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

Unified Diff: Source/wtf/Deque.h

Issue 1086413003: Oilpan: HeapVectorBacking should call destructors for its elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased past r194046 (upto r194085.) Created 5 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
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Deque.h
diff --git a/Source/wtf/Deque.h b/Source/wtf/Deque.h
index d0c04a214b1736bbc5dc25beac5b1bf11d58b0e0..60eb8cfbe2c88d8f95231496efd8bcb717b580b8 100644
--- a/Source/wtf/Deque.h
+++ b/Source/wtf/Deque.h
@@ -338,17 +338,21 @@ namespace WTF {
} else {
size_t newStart = m_buffer.capacity() - (oldCapacity - m_start);
TypeOperations::moveOverlapping(oldBuffer + m_start, oldBuffer + oldCapacity, m_buffer.buffer() + newStart);
+ m_buffer.clearUnusedSlots(oldBuffer + m_start, oldBuffer + std::min(oldCapacity, newStart));
m_start = newStart;
}
return;
}
m_buffer.allocateBuffer(newCapacity);
- if (m_start <= m_end)
+ if (m_start <= m_end) {
TypeOperations::move(oldBuffer + m_start, oldBuffer + m_end, m_buffer.buffer() + m_start);
- else {
+ m_buffer.clearUnusedSlots(oldBuffer + m_start, oldBuffer + m_end);
+ } else {
TypeOperations::move(oldBuffer, oldBuffer + m_end, m_buffer.buffer());
+ m_buffer.clearUnusedSlots(oldBuffer, oldBuffer + m_end);
size_t newStart = m_buffer.capacity() - (oldCapacity - m_start);
TypeOperations::move(oldBuffer + m_start, oldBuffer + oldCapacity, m_buffer.buffer() + newStart);
+ m_buffer.clearUnusedSlots(oldBuffer + m_start, oldBuffer + oldCapacity);
m_start = newStart;
}
m_buffer.deallocateBuffer(oldBuffer);
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698