Changeset 38853 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Nov 30, 2008, 2:19:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.