| Index: Source/WTF/wtf/FastMalloc.cpp
|
| diff --git a/Source/WTF/wtf/FastMalloc.cpp b/Source/WTF/wtf/FastMalloc.cpp
|
| index 41112ed8010ec3c83b0eec0606f5a4ee11cfdae7..ec72a280cc6e895804f570b8463b8f8e6cd6616b 100644
|
| --- a/Source/WTF/wtf/FastMalloc.cpp
|
| +++ b/Source/WTF/wtf/FastMalloc.cpp
|
| @@ -78,7 +78,6 @@
|
| #include "FastMalloc.h"
|
|
|
| #include "Assertions.h"
|
| -#include "CurrentTime.h"
|
|
|
| #include <limits>
|
| #if OS(WINDOWS)
|
| @@ -103,16 +102,12 @@
|
| #endif
|
|
|
| // Harden the pointers stored in the TCMalloc linked lists
|
| -#if COMPILER(GCC) && !PLATFORM(QT)
|
| +#if COMPILER(GCC)
|
| #define ENABLE_TCMALLOC_HARDENING 1
|
| #endif
|
|
|
| // Use a background thread to periodically scavenge memory to release back to the system
|
| -#if PLATFORM(IOS)
|
| -#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 0
|
| -#else
|
| #define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 1
|
| -#endif
|
|
|
| #ifndef NDEBUG
|
| namespace WTF {
|
| @@ -660,11 +655,7 @@ static const int kMaxFreeListLength = 256;
|
|
|
| // Lower and upper bounds on the per-thread cache sizes
|
| static const size_t kMinThreadCacheSize = kMaxSize * 2;
|
| -#if PLATFORM(IOS)
|
| -static const size_t kMaxThreadCacheSize = 512 * 1024;
|
| -#else
|
| static const size_t kMaxThreadCacheSize = 2 << 20;
|
| -#endif
|
|
|
| // Default bound on the total amount of thread caches
|
| static const size_t kDefaultOverallThreadCacheSize = 16 << 20;
|
| @@ -2292,13 +2283,9 @@ void TCMalloc_PageHeap::IncrementalScavenge(Length n) {
|
| scavenge_counter_ -= n;
|
| if (scavenge_counter_ >= 0) return; // Not yet time to scavenge
|
|
|
| -#if PLATFORM(IOS)
|
| - static const size_t kDefaultReleaseDelay = 64;
|
| -#else
|
| // If there is nothing to release, wait for so many pages before
|
| // scavenging again. With 4K pages, this comes to 16MB of memory.
|
| static const size_t kDefaultReleaseDelay = 1 << 8;
|
| -#endif
|
|
|
| // Find index of free list to scavenge
|
| size_t index = scavenge_index_ + 1;
|
| @@ -2315,11 +2302,7 @@ void TCMalloc_PageHeap::IncrementalScavenge(Length n) {
|
| s->decommitted = true;
|
| DLL_Prepend(&slist->returned, s, entropy);
|
|
|
| -#if PLATFORM(IOS)
|
| - scavenge_counter_ = std::max<size_t>(16UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
|
| -#else
|
| scavenge_counter_ = std::max<size_t>(64UL, std::min<size_t>(kDefaultReleaseDelay, kDefaultReleaseDelay - (free_pages_ / kDefaultReleaseDelay)));
|
| -#endif
|
|
|
| if (index == kMaxPages && !DLL_IsEmpty(&slist->normal, entropy))
|
| scavenge_index_ = index - 1;
|
|
|