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

Unified Diff: third_party/tcmalloc/chromium/src/symbolize.h

Issue 1076002: Revert 41938 - Merged third_party/tcmalloc/vendor/src(googleperftools r87) in... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/symbolize.h
===================================================================
--- third_party/tcmalloc/chromium/src/symbolize.h (revision 41940)
+++ third_party/tcmalloc/chromium/src/symbolize.h (working copy)
@@ -33,50 +33,18 @@
#ifndef TCMALLOC_SYMBOLIZE_H_
#define TCMALLOC_SYMBOLIZE_H_
-#include "config.h"
-#ifdef HAVE_STDINT_H
-#include <stdint.h> // for uintptr_t
-#endif
#include <map>
using std::map;
-// SymbolTable encapsulates the address operations necessary for stack trace
-// symbolization. A common use-case is to Add() the addresses from one or
-// several stack traces to a table, call Symbolize() once and use GetSymbol()
-// to get the symbol names for pretty-printing the stack traces.
-class SymbolTable {
- public:
- SymbolTable()
- : symbol_buffer_(NULL) {}
- ~SymbolTable() {
- delete[] symbol_buffer_;
- }
+// An average size of memory allocated for a stack trace symbol.
+static const int kSymbolSize = 1024;
- // Adds an address to the table. This may overwrite a currently known symbol
- // name, so Add() should not generally be called after Symbolize().
- void Add(const void* addr);
+// TODO(glider): it's better to make SymbolMap a class that encapsulates the
+// address operations and has the Symbolize() method.
+typedef map<uintptr_t, char*> SymbolMap;
- // Returns the symbol name for addr, if the given address was added before
- // the last successful call to Symbolize(). Otherwise may return an empty
- // c-string.
- const char* GetSymbol(const void* addr);
+extern bool Symbolize(char *out, int out_size,
+ SymbolMap *symbolization_table);
- // Obtains the symbol names for the addresses stored in the table and returns
- // the number of addresses actually symbolized.
- int Symbolize();
-
- private:
- typedef map<const void*, const char*> SymbolMap;
-
- // An average size of memory allocated for a stack trace symbol.
- static const int kSymbolSize = 1024;
-
- // Map from addresses to symbol names.
- SymbolMap symbolization_table_;
-
- // Pointer to the buffer that stores the symbol names.
- char *symbol_buffer_;
-};
-
#endif // TCMALLOC_SYMBOLIZE_H_
« no previous file with comments | « third_party/tcmalloc/chromium/src/stacktrace_x86-inl.h ('k') | third_party/tcmalloc/chromium/src/symbolize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698