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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Refresh the mmap hash table and the allocated object map from | 184 // Refresh the mmap hash table and the allocated object map from |
185 // MemoryRegionMap. | 185 // MemoryRegionMap. |
186 void RefreshMMapData(); | 186 void RefreshMMapData(); |
187 | 187 |
188 // Clear the mmap hash table and remove the allocated object map. | 188 // Clear the mmap hash table and remove the allocated object map. |
189 // It doesn't remove the mmap hash table, but does clear sizes in buckets | 189 // It doesn't remove the mmap hash table, but does clear sizes in buckets |
190 // into zero. | 190 // into zero. |
191 void ClearMMapData(); | 191 void ClearMMapData(); |
192 | 192 |
193 private: | 193 private: |
| 194 friend class DeepHeapProfile; |
194 | 195 |
195 // data types ---------------------------- | 196 // data types ---------------------------- |
196 | 197 |
197 // Hash table bucket to hold (de)allocation stats | 198 // Hash table bucket to hold (de)allocation stats |
198 // for a given allocation call stack trace. | 199 // for a given allocation call stack trace. |
199 struct Bucket : public Stats { | 200 struct Bucket : public Stats { |
200 uintptr_t hash; // Hash value of the stack trace | 201 uintptr_t hash; // Hash value of the stack trace |
201 int depth; // Depth of stack trace | 202 int depth; // Depth of stack trace |
202 const void** stack; // Stack trace | 203 const void** stack; // Stack trace |
203 Bucket* next; // Next entry in hash-table | 204 Bucket* next; // Next entry in hash-table |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // Helpers for sorting and generating leak reports | 402 // Helpers for sorting and generating leak reports |
402 struct Entry; | 403 struct Entry; |
403 struct ReportState; | 404 struct ReportState; |
404 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); | 405 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); |
405 static void ReportObject(const void* ptr, AllocValue* v, char*); | 406 static void ReportObject(const void* ptr, AllocValue* v, char*); |
406 | 407 |
407 DISALLOW_COPY_AND_ASSIGN(Snapshot); | 408 DISALLOW_COPY_AND_ASSIGN(Snapshot); |
408 }; | 409 }; |
409 | 410 |
410 #endif // BASE_HEAP_PROFILE_TABLE_H_ | 411 #endif // BASE_HEAP_PROFILE_TABLE_H_ |
OLD | NEW |