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

Unified Diff: third_party/WebKit/Source/platform/wtf/Vector.h

Issue 2816373003: Oilpan: Allow clearing a vector during pre finalizer to disallocate the backing buffer (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/wtf/Vector.h
diff --git a/third_party/WebKit/Source/platform/wtf/Vector.h b/third_party/WebKit/Source/platform/wtf/Vector.h
index fe163631daf659731217938e87c850ead12812a2..3742c06f9355f245a41269a1bbbf59c9af1abb47 100644
--- a/third_party/WebKit/Source/platform/wtf/Vector.h
+++ b/third_party/WebKit/Source/platform/wtf/Vector.h
@@ -1626,9 +1626,6 @@ void Vector<T, inlineCapacity, Allocator>::ShrinkCapacity(size_t new_capacity) {
if (new_capacity < size())
Shrink(new_capacity);
- if (Allocator::IsObjectResurrectionForbidden())
- return;
-
T* old_buffer = begin();
#ifdef ANNOTATE_CONTIGUOUS_CONTAINER
size_t old_capacity = Capacity();
@@ -1639,6 +1636,9 @@ void Vector<T, inlineCapacity, Allocator>::ShrinkCapacity(size_t new_capacity) {
return;
}
+ if (Allocator::IsObjectResurrectionForbidden())
+ return;
+
T* old_end = end();
Base::AllocateBuffer(new_capacity);
if (begin() != old_buffer) {
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698