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

Unified Diff: Source/platform/heap/Heap.h

Issue 1104803002: Oilpan: expand size of vector backing container when finalizing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index e65d052f58f17ec5c9057d09a4d0b21751cfaabf..a072c4dd8dfa8a3a7169f33e32a30bbea7ee84f1 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -2184,10 +2184,14 @@ void HeapVectorBacking<T, Traits>::finalize(void* pointer)
// Use the payload size as recorded by the heap to determine how many
// elements to finalize.
size_t length = header->payloadSize() / sizeof(T);
- T* array = reinterpret_cast<T*>(pointer);
- for (unsigned i = 0; i < length; ++i) {
- array[i].~T();
- }
+ T* buffer = reinterpret_cast<T*>(pointer);
+#ifdef ANNOTATE_CONTIGUOUS_CONTAINER
+ // Like for trace(), have no option but to mark the whole container
+ // as accessible.
+ ANNOTATE_CHANGE_SIZE(buffer, length, 0, length);
+#endif
+ for (unsigned i = 0; i < length; ++i)
+ buffer[i].~T();
}
template<typename Table>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698