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

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

Issue 1754313002: Simplify the shutdown sequence of Oilpan's heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/Heap.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 69cbac7e9dff8c35817455a37765f05a7c1e92fc..d676331908191215109d75c322f67f0ee5688d57 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -138,19 +138,14 @@ void Heap::init()
void Heap::shutdown()
{
+ ASSERT(s_markingStack);
+
if (Platform::current() && Platform::current()->currentThread())
Platform::current()->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvider::instance());
- s_shutdownCalled = true;
- ThreadState::shutdownHeapIfNecessary();
-}
-void Heap::doShutdown()
-{
- // We don't want to call doShutdown() twice.
- if (!s_markingStack)
- return;
+ // The main thread must be the last thread that gets detached.
+ RELEASE_ASSERT(ThreadState::attachedThreads().size() == 0);
- ASSERT(!ThreadState::attachedThreads().size());
delete s_heapDoesNotContainCache;
s_heapDoesNotContainCache = nullptr;
delete s_freePagePool;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698