Changeset 38853 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Nov 30, 2008, 2:19:42 PM (16 years ago)
Author:
Antti Koivisto
Message:

JavaScriptCore:

2008-11-30 Antti Koivisto <Antti Koivisto>

Reviewed by Mark Rowe.


https://bugs.webkit.org/show_bug.cgi?id=22557


Report free size in central and thread caches too.

  • wtf/FastMalloc.cpp: (WTF::TCMallocStats::fastMallocStatistics):
  • wtf/FastMalloc.h:

WebKit/mac:

2008-11-30 Antti Koivisto <Antti Koivisto>

Reviewed by Mark Rowe.


https://bugs.webkit.org/show_bug.cgi?id=22557


Report free size in central and thread caches too.

  • Misc/WebCoreStatistics.mm: (+[WebCoreStatistics memoryStatistics]):
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38849 r38853  
     12008-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
    1132008-11-29  Antti Koivisto  <[email protected]>
    214
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r38848 r38853  
    236236FastMallocStatistics fastMallocStatistics()
    237237{
    238     FastMallocStatistics statistics;
    239     statistics.heapSize = 0;
    240     statistics.freeSize = 0;
    241     statistics.returnedSize = 0;
     238    FastMallocStatistics statistics = { 0, 0, 0, 0 };
    242239    return statistics;
    243240}
     
    38553852FastMallocStatistics fastMallocStatistics()
    38563853{
    3857     SpinLockHolder h(&pageheap_lock);
    3858 
    38593854    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    }
    38633869    return statistics;
    38643870}
  • trunk/JavaScriptCore/wtf/FastMalloc.h

    r38844 r38853  
    5454    struct FastMallocStatistics {
    5555        size_t heapSize;
    56         size_t freeSize;
     56        size_t freeSizeInHeap;
     57        size_t freeSizeInCaches;
    5758        size_t returnedSize;
    5859    };
Note: See TracChangeset for help on using the changeset viewer.