Ignore:
Timestamp:
Jun 23, 2008, 10:34:21 PM (17 years ago)
Author:
[email protected]
Message:

Remove the sample member of Span when NO_TCMALLOC_SAMPLES is defined.

Reviewed by Sam Weinig.

  • wtf/FastMalloc.cpp:

(WTF::TCMalloc_PageHeap::Delete): Only update Span::sample if NO_TCMALLOC_SAMPLES is not defined.
(WTF::TCMallocStats::do_free): Ditto.

File:
1 edited

Legend:

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

    r34028 r34755  
    865865  void*         objects;        // Linked list of free objects
    866866  unsigned int  free : 1;       // Is the span free
     867#ifndef NO_TCMALLOC_SAMPLES
    867868  unsigned int  sample : 1;     // Sampled object?
     869#endif
    868870  unsigned int  sizeclass : 8;  // Size-class for small objects (or 0)
    869871  unsigned int  refcount : 11;  // Number of non-free objects
     
    12871289  ASSERT(GetDescriptor(span->start + span->length - 1) == span);
    12881290  span->sizeclass = 0;
     1291#ifndef NO_TCMALLOC_SAMPLES
    12891292  span->sample = 0;
     1293#endif
    12901294
    12911295  // Coalesce -- we guarantee that "p" != 0, so no bounds checking
     
    29532957  }
    29542958  if (cl != 0) {
     2959#ifndef NO_TCMALLOC_SAMPLES
    29552960    ASSERT(!pageheap->GetDescriptor(p)->sample);
     2961#endif
    29562962    TCMalloc_ThreadCache* heap = TCMalloc_ThreadCache::GetCacheIfPresent();
    29572963    if (heap != NULL) {
     
    29662972    ASSERT(reinterpret_cast<uintptr_t>(ptr) % kPageSize == 0);
    29672973    ASSERT(span != NULL && span->start == p);
     2974#ifndef NO_TCMALLOC_SAMPLES
    29682975    if (span->sample) {
    29692976      DLL_Remove(span);
     
    29712978      span->objects = NULL;
    29722979    }
     2980#endif
    29732981    pageheap->Delete(span);
    29742982  }
Note: See TracChangeset for help on using the changeset viewer.