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

Unified Diff: Source/wtf/FastMalloc.cpp

Issue 345203007: Remove WTF_USE_SYSTEM_MALLOC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/config.h ('k') | no next file » | 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 24640bbbd558cedbf4e8b5b99317c3bc09bb6658..3b3d8d2aaf823a8451cbb05ea7e690b54b6675f5 100644
--- a/Source/wtf/FastMalloc.cpp
+++ b/Source/wtf/FastMalloc.cpp
@@ -31,10 +31,16 @@
#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);
@@ -56,54 +62,6 @@ FastMallocStatistics fastMallocStatistics()
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();
@@ -133,5 +91,3 @@ void* fastRealloc(void* p, size_t n)
}
} // namespace WTF
-
-#endif // USE(SYSTEM_MALLOC)
« no previous file with comments | « Source/config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698