OLD | NEW |
1 // Copyright (c) 2009, Google Inc. | 1 // Copyright (c) 2009, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... |
33 #ifndef TCMALLOC_SYMBOLIZE_H_ | 33 #ifndef TCMALLOC_SYMBOLIZE_H_ |
34 #define TCMALLOC_SYMBOLIZE_H_ | 34 #define TCMALLOC_SYMBOLIZE_H_ |
35 | 35 |
36 #include "config.h" | 36 #include "config.h" |
37 #ifdef HAVE_STDINT_H | 37 #ifdef HAVE_STDINT_H |
38 #include <stddef.h> | 38 #include <stddef.h> |
39 #include <stdint.h> // for uintptr_t | 39 #include <stdint.h> // for uintptr_t |
40 #endif | 40 #endif |
41 #include <stddef.h> // for NULL | 41 #include <stddef.h> // for NULL |
42 #include <map> | 42 #include <map> |
| 43 #include <cstddef> |
43 | 44 |
44 using std::map; | 45 using std::map; |
45 | 46 |
46 // SymbolTable encapsulates the address operations necessary for stack trace | 47 // SymbolTable encapsulates the address operations necessary for stack trace |
47 // symbolization. A common use-case is to Add() the addresses from one or | 48 // symbolization. A common use-case is to Add() the addresses from one or |
48 // several stack traces to a table, call Symbolize() once and use GetSymbol() | 49 // several stack traces to a table, call Symbolize() once and use GetSymbol() |
49 // to get the symbol names for pretty-printing the stack traces. | 50 // to get the symbol names for pretty-printing the stack traces. |
50 class SymbolTable { | 51 class SymbolTable { |
51 public: | 52 public: |
52 SymbolTable() | 53 SymbolTable() |
(...skipping 22 matching lines...) Expand all Loading... |
75 static const int kSymbolSize = 1024; | 76 static const int kSymbolSize = 1024; |
76 | 77 |
77 // Map from addresses to symbol names. | 78 // Map from addresses to symbol names. |
78 SymbolMap symbolization_table_; | 79 SymbolMap symbolization_table_; |
79 | 80 |
80 // Pointer to the buffer that stores the symbol names. | 81 // Pointer to the buffer that stores the symbol names. |
81 char *symbol_buffer_; | 82 char *symbol_buffer_; |
82 }; | 83 }; |
83 | 84 |
84 #endif // TCMALLOC_SYMBOLIZE_H_ | 85 #endif // TCMALLOC_SYMBOLIZE_H_ |
OLD | NEW |