| Index: third_party/tcmalloc/chromium/src/heap-profile-table.cc
|
| ===================================================================
|
| --- third_party/tcmalloc/chromium/src/heap-profile-table.cc (revision 41940)
|
| +++ third_party/tcmalloc/chromium/src/heap-profile-table.cc (working copy)
|
| @@ -549,17 +549,22 @@
|
| RAW_LOG(ERROR, "The %d largest leaks:", to_report);
|
|
|
| // Print
|
| - SymbolTable symbolization_table;
|
| + SymbolMap symbolization_table;
|
| + int num_symbols = 0;
|
| for (int i = 0; i < to_report; i++) {
|
| const Entry& e = entries[i];
|
| for (int j = 0; j < e.bucket->depth; j++) {
|
| - symbolization_table.Add(e.bucket->stack[j]);
|
| + const void* pc = e.bucket->stack[j];
|
| + symbolization_table[reinterpret_cast<uintptr_t>(pc)] = "";
|
| + num_symbols++;
|
| }
|
| }
|
| 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)
|
| - symbolization_table.Symbolize();
|
| + Symbolize(sym_buffer, sym_buffer_len, &symbolization_table);
|
| for (int i = 0; i < to_report; i++) {
|
| const Entry& e = entries[i];
|
| base::RawPrinter printer(buffer, kBufSize);
|
| @@ -567,11 +572,12 @@
|
| e.bytes, e.count);
|
| for (int j = 0; j < e.bucket->depth; j++) {
|
| const void* pc = e.bucket->stack[j];
|
| - printer.Printf("\t@ %"PRIxPTR" %s\n",
|
| - reinterpret_cast<uintptr_t>(pc), symbolization_table.GetSymbol(pc));
|
| + printer.Printf("\t@ %p %s\n",
|
| + pc, symbolization_table[reinterpret_cast<uintptr_t>(pc)]);
|
| }
|
| RAW_LOG(ERROR, "%s", buffer);
|
| }
|
| + delete[] sym_buffer;
|
|
|
| if (to_report < n) {
|
| RAW_LOG(ERROR, "Skipping leaks numbered %d..%d",
|
|
|