| Index: third_party/tcmalloc/chromium/src/common.h
|
| ===================================================================
|
| --- third_party/tcmalloc/chromium/src/common.h (revision 126022)
|
| +++ third_party/tcmalloc/chromium/src/common.h (working copy)
|
| @@ -31,7 +31,6 @@
|
| // Author: Sanjay Ghemawat <opensource@google.com>
|
| //
|
| // Common definitions for tcmalloc code.
|
| -
|
| #ifndef TCMALLOC_COMMON_H_
|
| #define TCMALLOC_COMMON_H_
|
|
|
| @@ -64,8 +63,7 @@
|
|
|
| static const size_t kAlignment = 8;
|
|
|
| -// Constants dependant on tcmalloc configuration and archetecture. Chromium
|
| -// tunes these constants.
|
| +// Constants dependant on tcmalloc configuration and archetecture.
|
| // 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 =
|
| @@ -77,16 +75,16 @@
|
|
|
| #if defined(TCMALLOC_LARGE_PAGES)
|
| static const size_t kPageShift = 15;
|
| -static const size_t kNumClasses = 78 - kSkippedClasses;
|
| +static const size_t kNumClasses = 95 - kSkippedClasses;
|
| +static const size_t kMaxThreadCacheSize = 4 << 20;
|
| #else
|
| -static const size_t kPageShift = 13;
|
| -static const size_t kNumClasses = 86 - kSkippedClasses;
|
| +static const size_t kPageShift = 12;
|
| +static const size_t kNumClasses = 61 - kSkippedClasses;
|
| +static const size_t kMaxThreadCacheSize = 2 << 20;
|
| #endif
|
| -static const size_t kMaxThreadCacheSize = 4 << 20;
|
|
|
| static const size_t kPageSize = 1 << kPageShift;
|
| -// TODO(dmikurube): We Chromium may want to tune this kMaxSize.
|
| -static const size_t kMaxSize = 256 * 1024;
|
| +static const size_t kMaxSize = 8u * kPageSize;
|
| // For all span-lengths < kMaxPages we keep an exact-size list.
|
| static const size_t kMaxPages = 1 << (20 - kPageShift);
|
|
|
| @@ -178,7 +176,7 @@
|
| // 32768 (32768 + 127 + (120<<7)) / 128 376
|
| static const int kMaxSmallSize = 1024;
|
| static const size_t kClassArraySize =
|
| - ((kMaxSize + 127 + (120 << 7)) >> 7) + 1;
|
| + (((1 << kPageShift) * 8u + 127 + (120 << 7)) >> 7) + 1;
|
| unsigned char class_array_[kClassArraySize];
|
|
|
| // Compute index of the class_array[] entry for a given size
|
| @@ -234,6 +232,9 @@
|
| 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
|
|
|