| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 // Return a snapshot of every non-live, non-ignored object in *this. | 184 // Return a snapshot of every non-live, non-ignored object in *this. |
| 185 // If "base" is non-NULL, skip any objects present in "base". | 185 // If "base" is non-NULL, skip any objects present in "base". |
| 186 // As a side-effect, clears the "live" bit on every live object in *this. | 186 // As a side-effect, clears the "live" bit on every live object in *this. |
| 187 // Caller must call ReleaseSnapshot() on result when no longer needed. | 187 // Caller must call ReleaseSnapshot() on result when no longer needed. |
| 188 Snapshot* NonLiveSnapshot(Snapshot* base); | 188 Snapshot* NonLiveSnapshot(Snapshot* base); |
| 189 | 189 |
| 190 // Refresh the internal mmap information from MemoryRegionMap. Results of | 190 // Refresh the internal mmap information from MemoryRegionMap. Results of |
| 191 // FillOrderedProfile and IterateOrderedAllocContexts will contain mmap'ed | 191 // FillOrderedProfile and IterateOrderedAllocContexts will contain mmap'ed |
| 192 // memory regions as at calling RefreshMMapData. | 192 // memory regions as at calling RefreshMMapData. |
| 193 void RefreshMMapData(); | 193 // 'mmap_alloc' is an allocator for an address map. A function which calls |
| 194 // LowLevelAlloc::AllocWithArena is expected like the constractor. |
| 195 // 'mmap_dealloc' is a corresponding deallocator to 'mmap_alloc'. |
| 196 // They are introduced to avoid expected memory fragmentation and bloat in |
| 197 // an arena. A dedicated arena for this function allows disposing whole the |
| 198 // arena after ClearMMapData. |
| 199 void RefreshMMapData(Allocator mmap_alloc, DeAllocator mmap_dealloc); |
| 194 | 200 |
| 195 // Clear the internal mmap information. Results of FillOrderedProfile and | 201 // Clear the internal mmap information. Results of FillOrderedProfile and |
| 196 // IterateOrderedAllocContexts won't contain mmap'ed memory regions after | 202 // IterateOrderedAllocContexts won't contain mmap'ed memory regions after |
| 197 // calling ClearMMapData. | 203 // calling ClearMMapData. |
| 198 void ClearMMapData(); | 204 void ClearMMapData(); |
| 199 | 205 |
| 200 private: | 206 private: |
| 201 friend class DeepHeapProfile; | 207 friend class DeepHeapProfile; |
| 202 | 208 |
| 203 // data types ---------------------------- | 209 // data types ---------------------------- |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // Helpers for sorting and generating leak reports | 420 // Helpers for sorting and generating leak reports |
| 415 struct Entry; | 421 struct Entry; |
| 416 struct ReportState; | 422 struct ReportState; |
| 417 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); | 423 static void ReportCallback(const void* ptr, AllocValue* v, ReportState*); |
| 418 static void ReportObject(const void* ptr, AllocValue* v, char*); | 424 static void ReportObject(const void* ptr, AllocValue* v, char*); |
| 419 | 425 |
| 420 DISALLOW_COPY_AND_ASSIGN(Snapshot); | 426 DISALLOW_COPY_AND_ASSIGN(Snapshot); |
| 421 }; | 427 }; |
| 422 | 428 |
| 423 #endif // BASE_HEAP_PROFILE_TABLE_H_ | 429 #endif // BASE_HEAP_PROFILE_TABLE_H_ |
| OLD | NEW |