Ignore:
Timestamp:
Jul 24, 2009, 6:49:12 PM (16 years ago)
Author:
[email protected]
Message:

In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236:
Remove TCMALLOC_TRACK_DECOMMITED_SPANS. We'll always track decommitted spans.
We have tested this and show it has little impact on performance.

Reviewed by Mark Rowe.

  • wtf/FastMalloc.cpp: (WTF::TCMalloc_PageHeap::New): (WTF::TCMalloc_PageHeap::AllocLarge): (WTF::propagateDecommittedState): (WTF::mergeDecommittedStates): (WTF::TCMalloc_PageHeap::Delete): (WTF::TCMalloc_PageHeap::IncrementalScavenge):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r46180 r46387  
    9696#endif
    9797
    98 #define TCMALLOC_TRACK_DECOMMITED_SPANS (HAVE(VIRTUALALLOC) || HAVE(MADV_FREE_REUSE))
    99 
    10098#ifndef NDEBUG
    10199namespace WTF {
     
    10441042};
    10451043
    1046 #if TCMALLOC_TRACK_DECOMMITED_SPANS
    10471044#define ASSERT_SPAN_COMMITTED(span) ASSERT(!span->decommitted)
    1048 #else
    1049 #define ASSERT_SPAN_COMMITTED(span)
    1050 #endif
    10511045
    10521046#ifdef SPAN_HISTORY
     
    13701364    Span* result = ll->next;
    13711365    Carve(result, n, released);
    1372 #if TCMALLOC_TRACK_DECOMMITED_SPANS
    13731366    if (result->decommitted) {
    13741367        TCMalloc_SystemCommit(reinterpret_cast<void*>(result->start << kPageShift), static_cast<size_t>(n << kPageShift));
    13751368        result->decommitted = false;
    13761369    }
    1377 #endif
    13781370    ASSERT(Check());
    13791371    free_pages_ -= n;
     
    14321424  if (best != NULL) {
    14331425    Carve(best, n, from_released);
    1434 #if TCMALLOC_TRACK_DECOMMITED_SPANS
    14351426    if (best->decommitted) {
    14361427        TCMalloc_SystemCommit(reinterpret_cast<void*>(best->start << kPageShift), static_cast<size_t>(n << kPageShift));
    14371428        best->decommitted = false;
    14381429    }
    1439 #endif
    14401430    ASSERT(Check());
    14411431    free_pages_ -= n;
     
    14621452}
    14631453
    1464 #if !TCMALLOC_TRACK_DECOMMITED_SPANS
    1465 static ALWAYS_INLINE void propagateDecommittedState(Span*, Span*) { }
    1466 #else
    14671454static ALWAYS_INLINE void propagateDecommittedState(Span* destination, Span* source)
    14681455{
    14691456    destination->decommitted = source->decommitted;
    14701457}
    1471 #endif
    14721458
    14731459inline void TCMalloc_PageHeap::Carve(Span* span, Length n, bool released) {
     
    14961482}
    14971483
    1498 #if !TCMALLOC_TRACK_DECOMMITED_SPANS
    1499 static ALWAYS_INLINE void mergeDecommittedStates(Span*, Span*) { }
    1500 #else
    15011484static ALWAYS_INLINE void mergeDecommittedStates(Span* destination, Span* other)
    15021485{
     
    15101493    }
    15111494}
    1512 #endif
    15131495
    15141496inline void TCMalloc_PageHeap::Delete(Span* span) {
     
    15571539  Event(span, 'D', span->length);
    15581540  span->free = 1;
    1559 #if TCMALLOC_TRACK_DECOMMITED_SPANS
    15601541  if (span->decommitted) {
    15611542    if (span->length < kMaxPages)
     
    15631544    else
    15641545      DLL_Prepend(&large_.returned, span);
    1565   } else
    1566 #endif
    1567   {
     1546  } else {
    15681547    if (span->length < kMaxPages)
    15691548      DLL_Prepend(&free_[span->length].normal, span);
     
    15971576      TCMalloc_SystemRelease(reinterpret_cast<void*>(s->start << kPageShift),
    15981577                             static_cast<size_t>(s->length << kPageShift));
    1599 #if TCMALLOC_TRACK_DECOMMITED_SPANS
    16001578      s->decommitted = true;
    1601 #endif
    16021579      DLL_Prepend(&slist->returned, s);
    16031580
Note: See TracChangeset for help on using the changeset viewer.