| Index: third_party/tcmalloc/chromium/src/page_heap.h
|
| diff --git a/third_party/tcmalloc/chromium/src/page_heap.h b/third_party/tcmalloc/chromium/src/page_heap.h
|
| index 19c143104fff4739adcdd52bd9e962e5021014e7..738c011214e32b5fe814b85590f12d30039815f7 100644
|
| --- a/third_party/tcmalloc/chromium/src/page_heap.h
|
| +++ b/third_party/tcmalloc/chromium/src/page_heap.h
|
| @@ -75,6 +75,8 @@ namespace tcmalloc {
|
| // -------------------------------------------------------------------------
|
|
|
| // We use PageMap2<> for 32-bit and PageMap3<> for 64-bit machines.
|
| +// ...except...
|
| +// On Windows, we use TCMalloc_PageMap1_LazyCommit<> for 32-bit machines.
|
| // We also use a simple one-level cache for hot PageID-to-sizeclass mappings,
|
| // because sometimes the sizeclass is all the information we need.
|
|
|
| @@ -88,7 +90,13 @@ template <int BITS> class MapSelector {
|
| // A two-level map for 32-bit machines
|
| template <> class MapSelector<32> {
|
| public:
|
| +#ifdef WIN32
|
| +// A flat map for 32-bit machines (with lazy commit of memory).
|
| + typedef TCMalloc_PageMap1_LazyCommit<32-kPageShift> Type;
|
| +#else
|
| + // A two-level map for 32-bit machines
|
| typedef TCMalloc_PageMap2<32-kPageShift> Type;
|
| +#endif
|
| typedef PackedCache<32-kPageShift, uint16_t> CacheType;
|
| };
|
|
|
| @@ -146,6 +154,8 @@ class PERFTOOLS_DLL_DECL PageHeap {
|
| uint64_t system_bytes; // Total bytes allocated from system
|
| uint64_t free_bytes; // Total bytes on normal freelists
|
| uint64_t unmapped_bytes; // Total bytes on returned freelists
|
| + uint64_t committed_bytes; // Bytes committed, always <= system_bytes_.
|
| +
|
| };
|
| inline Stats stats() const { return stats_; }
|
|
|
| @@ -206,11 +216,13 @@ class PERFTOOLS_DLL_DECL PageHeap {
|
| // Never delay scavenging for more than the following number of
|
| // deallocated pages. With 4K pages, this comes to 4GB of
|
| // deallocation.
|
| - static const int kMaxReleaseDelay = 1 << 20;
|
| + // Chrome: Changed to 64MB
|
| + static const int kMaxReleaseDelay = 1 << 14;
|
|
|
| // If there is nothing to release, wait for so many pages before
|
| // scavenging again. With 4K pages, this comes to 1GB of memory.
|
| - static const int kDefaultReleaseDelay = 1 << 18;
|
| + // Chrome: Changed to 16MB
|
| + static const int kDefaultReleaseDelay = 1 << 12;
|
|
|
| // Pick the appropriate map and cache types based on pointer size
|
| typedef MapSelector<kAddressBits>::Type PageMap;
|
| @@ -234,7 +246,6 @@ class PERFTOOLS_DLL_DECL PageHeap {
|
|
|
| // Statistics on system, free, and unmapped bytes
|
| Stats stats_;
|
| -
|
| Span* SearchFreeAndLargeLists(Length n);
|
|
|
| bool GrowHeap(Length n);
|
| @@ -263,6 +274,12 @@ class PERFTOOLS_DLL_DECL PageHeap {
|
| // appropriate free list, and adjust stats.
|
| void MergeIntoFreeList(Span* span);
|
|
|
| + // Commit the span.
|
| + void CommitSpan(Span* span);
|
| +
|
| + // Decommit the span.
|
| + void DecommitSpan(Span* span);
|
| +
|
| // Prepends span to appropriate free list, and adjusts stats.
|
| void PrependToFreeList(Span* span);
|
|
|
|
|