OLD | NEW |
1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // FillOrderedProfile and IterateOrderedAllocContexts will contain mmap'ed | 186 // FillOrderedProfile and IterateOrderedAllocContexts will contain mmap'ed |
187 // memory regions as at calling RefreshMMapData. | 187 // memory regions as at calling RefreshMMapData. |
188 void RefreshMMapData(); | 188 void RefreshMMapData(); |
189 | 189 |
190 // Clear the internal mmap information. Results of FillOrderedProfile and | 190 // Clear the internal mmap information. Results of FillOrderedProfile and |
191 // IterateOrderedAllocContexts won't contain mmap'ed memory regions after | 191 // IterateOrderedAllocContexts won't contain mmap'ed memory regions after |
192 // calling ClearMMapData. | 192 // calling ClearMMapData. |
193 void ClearMMapData(); | 193 void ClearMMapData(); |
194 | 194 |
195 private: | 195 private: |
| 196 friend class DeepHeapProfile; |
196 | 197 |
197 // data types ---------------------------- | 198 // data types ---------------------------- |
198 | 199 |
199 // Hash table bucket to hold (de)allocation stats | 200 // Hash table bucket to hold (de)allocation stats |
200 // for a given allocation call stack trace. | 201 // for a given allocation call stack trace. |
201 struct Bucket : public Stats { | 202 struct Bucket : public Stats { |
202 uintptr_t hash; // Hash value of the stack trace | 203 uintptr_t hash; // Hash value of the stack trace |
203 int depth; // Depth of stack trace | 204 int depth; // Depth of stack trace |
204 const void** stack; // Stack trace | 205 const void** stack; // Stack trace |
205 Bucket* next; // Next entry in hash-table | 206 Bucket* next; // Next entry in hash-table |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // Helpers for sorting and generating leak reports | 409 // Helpers for sorting and generating leak reports |
409 struct Entry; | 410 struct Entry; |
410 struct ReportState; | 411 struct ReportState; |
411 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); | 412 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); |
412 static void ReportObject(const void* ptr, AllocValue* v, char*); | 413 static void ReportObject(const void* ptr, AllocValue* v, char*); |
413 | 414 |
414 DISALLOW_COPY_AND_ASSIGN(Snapshot); | 415 DISALLOW_COPY_AND_ASSIGN(Snapshot); |
415 }; | 416 }; |
416 | 417 |
417 #endif // BASE_HEAP_PROFILE_TABLE_H_ | 418 #endif // BASE_HEAP_PROFILE_TABLE_H_ |
OLD | NEW |