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

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

Issue 2127453002: Oilpan: Introduce memory pool for CallbackStacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 4b975f7563be186de4180620a0a86bc2c6d30bfa..72e4e2b531526f129009d941ee43b67b9e9645bb 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -136,10 +136,7 @@ ThreadState::ThreadState(bool perThreadHeapEnabled)
m_likelyToBePromptlyFreed = wrapArrayUnique(new int[likelyToBePromptlyFreedArraySize]);
clearArenaAges();
- // 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);
+ m_threadLocalWeakCallbackStack = new CallbackStack();
}
ThreadState::~ThreadState()
@@ -963,7 +960,8 @@ void ThreadState::preGC()
// should only process callbacks that's found to be reachable by
// the latest GC, when it eventually gets to next perform
// thread-local weak processing.
- m_threadLocalWeakCallbackStack->clear();
+ m_threadLocalWeakCallbackStack->decommit();
sof 2016/07/05 14:19:02 Naming this clear() or reset() would be clearer, p
haraken 2016/07/06 01:58:11 We're already calling decommit() at the end of Thr
sof 2016/07/06 13:22:17 Ah, of course we already are; good.
+ m_threadLocalWeakCallbackStack->commit();
}
void ThreadState::postGC(BlinkGC::GCType gcType)

Powered by Google App Engine
This is Rietveld 408576698