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

Unified Diff: Source/wtf/FastMalloc.cpp

Issue 1044143002: Oilpan: Centralize Partition allocators into Partitions.h (part 2) (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/FastMalloc.h ('k') | Source/wtf/Partitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/FastMalloc.cpp
diff --git a/Source/wtf/FastMalloc.cpp b/Source/wtf/FastMalloc.cpp
index 68f79bd24baa0200fd8c37b3ab110df5ff218cbc..3bab74d3027153fbb7ef5d3b944155e2d66c8363 100644
--- a/Source/wtf/FastMalloc.cpp
+++ b/Source/wtf/FastMalloc.cpp
@@ -31,16 +31,11 @@
#include "config.h"
#include "wtf/FastMalloc.h"
-#include "wtf/PartitionAlloc.h"
-#include "wtf/SpinLock.h"
+#include "wtf/Partitions.h"
#include <string.h>
namespace WTF {
-static PartitionAllocatorGeneric gPartition;
-static int gLock = 0;
-static bool gInitialized = false;
-
void* fastZeroedMalloc(size_t n)
{
void* result = fastMalloc(n);
@@ -56,32 +51,19 @@ char* fastStrDup(const char* src)
return dup;
}
-void fastMallocShutdown()
-{
- gPartition.shutdown();
-}
-
void* fastMalloc(size_t n)
{
- if (UNLIKELY(!gInitialized)) {
- spinLockLock(&gLock);
- if (!gInitialized) {
- gInitialized = true;
- gPartition.init();
- }
- spinLockUnlock(&gLock);
- }
- return partitionAllocGeneric(gPartition.root(), n);
+ return partitionAllocGeneric(Partitions::getFastMallocPartition(), n);
}
void fastFree(void* p)
{
- partitionFreeGeneric(gPartition.root(), p);
+ partitionFreeGeneric(Partitions::getFastMallocPartition(), p);
}
void* fastRealloc(void* p, size_t n)
{
- return partitionReallocGeneric(gPartition.root(), p, n);
+ return partitionReallocGeneric(Partitions::getFastMallocPartition(), p, n);
}
} // namespace WTF
« no previous file with comments | « Source/wtf/FastMalloc.h ('k') | Source/wtf/Partitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698