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

Unified Diff: third_party/tcmalloc/chromium/src/heap-profile-table.cc

Issue 576001: Merged third_party/tcmalloc/vendor/src(google-perftools r87) into... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Removed the unnecessary printf and ASSERT(0) Created 10 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
Index: third_party/tcmalloc/chromium/src/heap-profile-table.cc
===================================================================
--- third_party/tcmalloc/chromium/src/heap-profile-table.cc (revision 41942)
+++ third_party/tcmalloc/chromium/src/heap-profile-table.cc (working copy)
@@ -549,22 +549,17 @@
RAW_LOG(ERROR, "The %d largest leaks:", to_report);
// Print
- SymbolMap symbolization_table;
- int num_symbols = 0;
+ SymbolTable symbolization_table;
for (int i = 0; i < to_report; i++) {
const Entry& e = entries[i];
for (int j = 0; j < e.bucket->depth; j++) {
- const void* pc = e.bucket->stack[j];
- symbolization_table[reinterpret_cast<uintptr_t>(pc)] = "";
- num_symbols++;
+ symbolization_table.Add(e.bucket->stack[j]);
}
}
static const int kBufSize = 2<<10;
char buffer[kBufSize];
- int sym_buffer_len = kSymbolSize * num_symbols;
- char *sym_buffer = new char[sym_buffer_len];
if (should_symbolize)
- Symbolize(sym_buffer, sym_buffer_len, &symbolization_table);
+ symbolization_table.Symbolize();
for (int i = 0; i < to_report; i++) {
const Entry& e = entries[i];
base::RawPrinter printer(buffer, kBufSize);
@@ -572,12 +567,11 @@
e.bytes, e.count);
for (int j = 0; j < e.bucket->depth; j++) {
const void* pc = e.bucket->stack[j];
- printer.Printf("\t@ %p %s\n",
- pc, symbolization_table[reinterpret_cast<uintptr_t>(pc)]);
+ printer.Printf("\t@ %"PRIxPTR" %s\n",
+ reinterpret_cast<uintptr_t>(pc), symbolization_table.GetSymbol(pc));
}
RAW_LOG(ERROR, "%s", buffer);
}
- delete[] sym_buffer;
if (to_report < n) {
RAW_LOG(ERROR, "Skipping leaks numbered %d..%d",
« no previous file with comments | « third_party/tcmalloc/chromium/src/heap-profile-table.h ('k') | third_party/tcmalloc/chromium/src/malloc_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698