Changeset 38853 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 30, 2008, 2:19:42 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38849 r38853 1 2008-11-30 Antti Koivisto <[email protected]> 2 3 Reviewed by Mark Rowe. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22557 6 7 Report free size in central and thread caches too. 8 9 * wtf/FastMalloc.cpp: 10 (WTF::TCMallocStats::fastMallocStatistics): 11 * wtf/FastMalloc.h: 12 1 13 2008-11-29 Antti Koivisto <[email protected]> 2 14 -
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r38848 r38853 236 236 FastMallocStatistics fastMallocStatistics() 237 237 { 238 FastMallocStatistics statistics; 239 statistics.heapSize = 0; 240 statistics.freeSize = 0; 241 statistics.returnedSize = 0; 238 FastMallocStatistics statistics = { 0, 0, 0, 0 }; 242 239 return statistics; 243 240 } … … 3855 3852 FastMallocStatistics fastMallocStatistics() 3856 3853 { 3857 SpinLockHolder h(&pageheap_lock);3858 3859 3854 FastMallocStatistics statistics; 3860 statistics.heapSize = static_cast<size_t>(pageheap->SystemBytes()); 3861 statistics.freeSize = static_cast<size_t>(pageheap->FreeBytes()); 3862 statistics.returnedSize = pageheap->ReturnedBytes(); 3855 { 3856 SpinLockHolder lockHolder(&pageheap_lock); 3857 statistics.heapSize = static_cast<size_t>(pageheap->SystemBytes()); 3858 statistics.freeSizeInHeap = static_cast<size_t>(pageheap->FreeBytes()); 3859 statistics.returnedSize = pageheap->ReturnedBytes(); 3860 statistics.freeSizeInCaches = 0; 3861 for (TCMalloc_ThreadCache* threadCache = thread_heaps; threadCache ; threadCache = threadCache->next_) 3862 statistics.freeSizeInCaches += threadCache->Size(); 3863 } 3864 for (unsigned cl = 0; cl < kNumClasses; ++cl) { 3865 const int length = central_cache[cl].length(); 3866 const int tc_length = central_cache[cl].tc_length(); 3867 statistics.freeSizeInCaches += ByteSizeForClass(cl) * (length + tc_length); 3868 } 3863 3869 return statistics; 3864 3870 } -
trunk/JavaScriptCore/wtf/FastMalloc.h
r38844 r38853 54 54 struct FastMallocStatistics { 55 55 size_t heapSize; 56 size_t freeSize; 56 size_t freeSizeInHeap; 57 size_t freeSizeInCaches; 57 58 size_t returnedSize; 58 59 };
Note:
See TracChangeset
for help on using the changeset viewer.