| 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
|
|
|