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

Unified Diff: Source/wtf/WTF.cpp

Issue 1041103002: PartitionAlloc: Centralize Partition allocators into one place (Part 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/wtf/WTF.h ('k') | Source/wtf/text/CString.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/WTF.cpp
diff --git a/Source/wtf/WTF.cpp b/Source/wtf/WTF.cpp
index d199fbe5fa7a4255611224d20faa5206f8284af3..d3ec16099d26dfdd6f911c4b2d618734f13bcb77 100644
--- a/Source/wtf/WTF.cpp
+++ b/Source/wtf/WTF.cpp
@@ -31,8 +31,9 @@
#include "config.h"
#include "WTF.h"
-#include "wtf/DefaultAllocator.h"
+#include "wtf/Assertions.h"
#include "wtf/FastMalloc.h"
+#include "wtf/Partitions.h"
namespace WTF {
@@ -40,8 +41,6 @@ extern void initializeThreading();
bool s_initialized;
bool s_shutdown;
-bool Partitions::s_initialized;
-PartitionAllocatorGeneric Partitions::m_bufferAllocator;
void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncreasingTimeFunction)
{
@@ -50,9 +49,9 @@ void initialize(TimeFunction currentTimeFunction, TimeFunction monotonicallyIncr
ASSERT(!s_initialized);
ASSERT(!s_shutdown);
s_initialized = true;
- Partitions::initialize();
setCurrentTimeFunction(currentTimeFunction);
setMonotonicallyIncreasingTimeFunction(monotonicallyIncreasingTimeFunction);
+ Partitions::initialize();
initializeThreading();
}
@@ -69,22 +68,4 @@ bool isShutdown()
return s_shutdown;
}
-void Partitions::initialize()
-{
- static int lock = 0;
- // Guard against two threads hitting here in parallel.
- spinLockLock(&lock);
- if (!s_initialized) {
- m_bufferAllocator.init();
- s_initialized = true;
- }
- spinLockUnlock(&lock);
-}
-
-void Partitions::shutdown()
-{
- fastMallocShutdown();
- m_bufferAllocator.shutdown();
-}
-
} // namespace WTF
« no previous file with comments | « Source/wtf/WTF.h ('k') | Source/wtf/text/CString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698