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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 1750553002: Reduce weak callback stack reservation for non-main threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whitespace Created 4 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/Source/platform/heap/CallbackStack.h ('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/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index ce9f9f8ba011a45581217a76cb6c1985175b0d9f..664912e0808a04039fe4dfcf05f5456d0f8f4160 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -131,7 +131,10 @@ ThreadState::ThreadState()
m_likelyToBePromptlyFreed = adoptArrayPtr(new int[likelyToBePromptlyFreedArraySize]);
clearHeapAges();
- m_threadLocalWeakCallbackStack = new CallbackStack();
+ // There is little use of weak references and collections off the main thread;
+ // use a much lower initial block reservation.
+ size_t initialBlockSize = isMainThread() ? CallbackStack::kDefaultBlockSize : CallbackStack::kMinimalBlockSize;
+ m_threadLocalWeakCallbackStack = new CallbackStack(initialBlockSize);
}
ThreadState::~ThreadState()
« no previous file with comments | « third_party/WebKit/Source/platform/heap/CallbackStack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698