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

Unified Diff: third_party/tcmalloc/chromium/src/static_vars.cc

Issue 9311003: Update the tcmalloc chromium branch to r144 (gperftools 2.0), and merge chromium-specific changes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasec Created 8 years, 10 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/static_vars.h ('k') | third_party/tcmalloc/chromium/src/symbolize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/static_vars.cc
diff --git a/third_party/tcmalloc/chromium/src/static_vars.cc b/third_party/tcmalloc/chromium/src/static_vars.cc
index 2ca132e46eab49da5e2c91fa2544d282ad260a0c..6fc852a82d1f2edb6e48f8d6ce2f100f80b4feab 100644
--- a/third_party/tcmalloc/chromium/src/static_vars.cc
+++ b/third_party/tcmalloc/chromium/src/static_vars.cc
@@ -34,6 +34,7 @@
#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 {
@@ -46,7 +47,7 @@ PageHeapAllocator<StackTrace> Static::stacktrace_allocator_;
Span Static::sampled_objects_;
PageHeapAllocator<StackTraceTable::Bucket> Static::bucket_allocator_;
StackTrace* Static::growth_stacks_ = NULL;
-char Static::pageheap_memory_[sizeof(PageHeap)];
+PageHeap* Static::pageheap_ = NULL;
void Static::InitStaticVars() {
sizemap_.Init();
@@ -60,7 +61,11 @@ void Static::InitStaticVars() {
for (int i = 0; i < kNumClasses; ++i) {
central_cache_[i].Init(i);
}
- new ((void*)pageheap_memory_) PageHeap;
+ // 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;
DLL_Init(&sampled_objects_);
Sampler::InitStatics();
}
« no previous file with comments | « third_party/tcmalloc/chromium/src/static_vars.h ('k') | third_party/tcmalloc/chromium/src/symbolize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698