| Index: third_party/tcmalloc/chromium/src/static_vars.cc
|
| ===================================================================
|
| --- third_party/tcmalloc/chromium/src/static_vars.cc (revision 126022)
|
| +++ third_party/tcmalloc/chromium/src/static_vars.cc (working copy)
|
| @@ -34,7 +34,6 @@
|
| #include <stddef.h> // for NULL
|
| #include <new> // for operator new
|
| #include "internal_logging.h" // for CHECK_CONDITION
|
| -#include "common.h"
|
| #include "sampler.h" // for Sampler
|
|
|
| namespace tcmalloc {
|
| @@ -47,7 +46,7 @@
|
| Span Static::sampled_objects_;
|
| PageHeapAllocator<StackTraceTable::Bucket> Static::bucket_allocator_;
|
| StackTrace* Static::growth_stacks_ = NULL;
|
| -PageHeap* Static::pageheap_ = NULL;
|
| +char Static::pageheap_memory_[sizeof(PageHeap)];
|
|
|
| void Static::InitStaticVars() {
|
| sizemap_.Init();
|
| @@ -61,11 +60,7 @@
|
| for (int i = 0; i < kNumClasses; ++i) {
|
| central_cache_[i].Init(i);
|
| }
|
| - // It's important to have PageHeap allocated, not in static storage,
|
| - // so that HeapLeakChecker does not consider all the byte patterns stored
|
| - // in is caches as pointers that are sources of heap object liveness,
|
| - // which leads to it missing some memory leaks.
|
| - pageheap_ = new (MetaDataAlloc(sizeof(PageHeap))) PageHeap;
|
| + new ((void*)pageheap_memory_) PageHeap;
|
| DLL_Init(&sampled_objects_);
|
| Sampler::InitStatics();
|
| }
|
|
|