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

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

Issue 9666033: Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « third_party/tcmalloc/chromium/src/central_freelist.cc ('k') | third_party/tcmalloc/chromium/src/common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/common.h
diff --git a/third_party/tcmalloc/chromium/src/common.h b/third_party/tcmalloc/chromium/src/common.h
index 78cdc036ceb27bf3538d6c3411810f9a27757ce9..4f848fa2f01013cf53931cf42b354c460d6585d5 100644
--- a/third_party/tcmalloc/chromium/src/common.h
+++ b/third_party/tcmalloc/chromium/src/common.h
@@ -31,6 +31,7 @@
// Author: Sanjay Ghemawat <opensource@google.com>
//
// Common definitions for tcmalloc code.
+
#ifndef TCMALLOC_COMMON_H_
#define TCMALLOC_COMMON_H_
@@ -63,7 +64,8 @@ typedef uintptr_t Length;
static const size_t kAlignment = 8;
-// Constants dependant on tcmalloc configuration and archetecture.
+// Constants dependant on tcmalloc configuration and archetecture. Chromium
+// tunes these constants.
// We need to guarantee the smallest class size is big enough to hold the
// pointers that form the free list.
static const size_t kNumFreeListPointers =
@@ -75,16 +77,16 @@ static const size_t kSkippedClasses = (kAlignment < kMinClassSize ? 1 : 0);
#if defined(TCMALLOC_LARGE_PAGES)
static const size_t kPageShift = 15;
-static const size_t kNumClasses = 95 - kSkippedClasses;
-static const size_t kMaxThreadCacheSize = 4 << 20;
+static const size_t kNumClasses = 78 - kSkippedClasses;
#else
-static const size_t kPageShift = 12;
-static const size_t kNumClasses = 61 - kSkippedClasses;
-static const size_t kMaxThreadCacheSize = 2 << 20;
+static const size_t kPageShift = 13;
+static const size_t kNumClasses = 86 - kSkippedClasses;
#endif
+static const size_t kMaxThreadCacheSize = 4 << 20;
static const size_t kPageSize = 1 << kPageShift;
-static const size_t kMaxSize = 8u * kPageSize;
+// TODO(dmikurube): We Chromium may want to tune this kMaxSize.
+static const size_t kMaxSize = 256 * 1024;
// For all span-lengths < kMaxPages we keep an exact-size list.
static const size_t kMaxPages = 1 << (20 - kPageShift);
@@ -176,7 +178,7 @@ class SizeMap {
// 32768 (32768 + 127 + (120<<7)) / 128 376
static const int kMaxSmallSize = 1024;
static const size_t kClassArraySize =
- (((1 << kPageShift) * 8u + 127 + (120 << 7)) >> 7) + 1;
+ ((kMaxSize + 127 + (120 << 7)) >> 7) + 1;
unsigned char class_array_[kClassArraySize];
// Compute index of the class_array[] entry for a given size
@@ -232,9 +234,6 @@ class SizeMap {
inline int num_objects_to_move(size_t cl) {
return num_objects_to_move_[cl];
}
-
- // Dump contents of the computed size map
- void Dump(TCMalloc_Printer* out);
};
// Allocates "bytes" worth of memory and returns it. Increments
« no previous file with comments | « third_party/tcmalloc/chromium/src/central_freelist.cc ('k') | third_party/tcmalloc/chromium/src/common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698