Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / wtf / FastMalloc.cpp
index 1c5bd47..68f79bd 100644 (file)
 #include "config.h"
 #include "wtf/FastMalloc.h"
 
+#include "wtf/PartitionAlloc.h"
+#include "wtf/SpinLock.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);
@@ -50,63 +56,6 @@ char* fastStrDup(const char* src)
     return dup;
 }
 
-// TODO: remove these two.
-void releaseFastMallocFreeMemory() { }
-
-FastMallocStatistics fastMallocStatistics()
-{
-    FastMallocStatistics statistics = { 0, 0, 0 };
-    return statistics;
-}
-
-} // namespace WTF
-
-#if USE(SYSTEM_MALLOC)
-
-#include "wtf/Assertions.h"
-
-#include <stdlib.h>
-
-namespace WTF {
-
-void fastMallocShutdown()
-{
-}
-
-void* fastMalloc(size_t n)
-{
-    void* result = malloc(n);
-    ASSERT(result);  // We expect tcmalloc underneath, which would crash instead of getting here.
-
-    return result;
-}
-
-void fastFree(void* p)
-{
-    free(p);
-}
-
-void* fastRealloc(void* p, size_t n)
-{
-    void* result = realloc(p, n);
-    ASSERT(result);  // We expect tcmalloc underneath, which would crash instead of getting here.
-
-    return result;
-}
-
-} // namespace WTF
-
-#else // USE(SYSTEM_MALLOC)
-
-#include "wtf/PartitionAlloc.h"
-#include "wtf/SpinLock.h"
-
-namespace WTF {
-
-static PartitionAllocatorGeneric gPartition;
-static int gLock = 0;
-static bool gInitialized = false;
-
 void fastMallocShutdown()
 {
     gPartition.shutdown();
@@ -136,5 +85,3 @@ void* fastRealloc(void* p, size_t n)
 }
 
 } // namespace WTF
-
-#endif // USE(SYSTEM_MALLOC)