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

Unified Diff: third_party/WebKit/JavaScriptCore/wtf/Vector.h

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « third_party/WebKit/JavaScriptCore/wrec/WRECGenerator.cpp ('k') | third_party/WebKit/WebCore/ChangeLog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/JavaScriptCore/wtf/Vector.h
===================================================================
--- third_party/WebKit/JavaScriptCore/wtf/Vector.h (revision 9118)
+++ third_party/WebKit/JavaScriptCore/wtf/Vector.h (working copy)
@@ -503,6 +503,7 @@
void grow(size_t size);
void resize(size_t size);
void reserveCapacity(size_t newCapacity);
+ void reserveInitialCapacity(size_t initialCapacity);
void shrinkCapacity(size_t newCapacity);
void shrinkToFit() { shrinkCapacity(size()); }
@@ -733,6 +734,15 @@
}
template<typename T, size_t inlineCapacity>
+ inline void Vector<T, inlineCapacity>::reserveInitialCapacity(size_t initialCapacity)
+ {
+ ASSERT(!m_size);
+ ASSERT(capacity() == inlineCapacity);
+ if (initialCapacity > inlineCapacity)
+ m_buffer.allocateBuffer(initialCapacity);
+ }
+
+ template<typename T, size_t inlineCapacity>
void Vector<T, inlineCapacity>::shrinkCapacity(size_t newCapacity)
{
if (newCapacity >= capacity())
« no previous file with comments | « third_party/WebKit/JavaScriptCore/wrec/WRECGenerator.cpp ('k') | third_party/WebKit/WebCore/ChangeLog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698