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

Unified Diff: third_party/tcmalloc/chromium/src/page_heap.h

Issue 9320005: [NOT TO COMMIT!] Replace third_party/tcmalloc/chromium with tcmalloc r136 (the latest). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 11 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
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 ab7a5414bb71c66129b2ae1f48d604171660ac07..19c143104fff4739adcdd52bd9e962e5021014e7 100644
--- a/third_party/tcmalloc/chromium/src/page_heap.h
+++ b/third_party/tcmalloc/chromium/src/page_heap.h
@@ -64,7 +64,6 @@
# include <google/stacktrace.h>
#endif
-class TCMalloc_Printer;
namespace base {
struct MallocRange;
}
@@ -76,8 +75,6 @@ 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.
@@ -91,13 +88,7 @@ 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;
};
@@ -145,9 +136,6 @@ class PERFTOOLS_DLL_DECL PageHeap {
return reinterpret_cast<Span*>(pagemap_.get(p));
}
- // Dump state to stderr
- void Dump(TCMalloc_Printer* out);
-
// If this page heap is managing a range with starting page # >= start,
// store info about the range in *r and return true. Else return false.
bool GetNextRange(PageID start, base::MallocRange* r);
@@ -158,14 +146,24 @@ 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_; }
- void GetClassSizes(int64 class_sizes_normal[kMaxPages],
- int64 class_sizes_returned[kMaxPages],
- int64* normal_pages_in_spans,
- int64* returned_pages_in_spans);
+
+ struct SmallSpanStats {
+ // For each free list of small spans, the length (in spans) of the
+ // normal and returned free lists for that size.
+ int64 normal_length[kMaxPages];
+ int64 returned_length[kMaxPages];
+ };
+ void GetSmallSpanStats(SmallSpanStats* result);
+
+ // Stats for free large spans (i.e., spans with more than kMaxPages pages).
+ struct LargeSpanStats {
+ int64 spans; // Number of such spans
+ int64 normal_pages; // Combined page length of normal large spans
+ int64 returned_pages; // Combined page length of unmapped spans
+ };
+ void GetLargeSpanStats(LargeSpanStats* result);
bool Check();
// Like Check() but does some more comprehensive checking.
@@ -208,13 +206,11 @@ 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.
- // Chrome: Changed to 64MB
- static const int kMaxReleaseDelay = 1 << 14;
+ static const int kMaxReleaseDelay = 1 << 20;
// If there is nothing to release, wait for so many pages before
// scavenging again. With 4K pages, this comes to 1GB of memory.
- // Chrome: Changed to 16MB
- static const int kDefaultReleaseDelay = 1 << 12;
+ static const int kDefaultReleaseDelay = 1 << 18;
// Pick the appropriate map and cache types based on pointer size
typedef MapSelector<kAddressBits>::Type PageMap;
@@ -238,6 +234,7 @@ class PERFTOOLS_DLL_DECL PageHeap {
// Statistics on system, free, and unmapped bytes
Stats stats_;
+
Span* SearchFreeAndLargeLists(Length n);
bool GrowHeap(Length n);
@@ -266,12 +263,6 @@ 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);
« no previous file with comments | « third_party/tcmalloc/chromium/src/packed-cache-inl.h ('k') | third_party/tcmalloc/chromium/src/page_heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698