Ignore:
Timestamp:
Aug 31, 2010, 2:34:43 PM (15 years ago)
Author:
Darin Adler
Message:
  • wtf/FastMalloc.cpp:

(WTF::TCMalloc_PageHeap::scavenge): Replaced somewhat-quirky code that
mixed types with code that uses size_t.

Reviewed by Anders Carlsson.

  • wtf/TCPageMap.h: Removed names of unused arguments to avoid warning.
File:
1 edited

Legend:

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

    r65311 r66538  
    15471547            // If the span size is bigger than kMinSpanListsWithSpans pages return all the spans in the list, else return all but 1 span. 
    15481548            // Return only 50% of a spanlist at a time so spans of size 1 are not the only ones left.
    1549             size_t numSpansToReturn = (i > kMinSpanListsWithSpans) ? DLL_Length(&slist->normal) : static_cast<size_t>(.5 * DLL_Length(&slist->normal));
     1549            size_t length = DLL_Length(&slist->normal);
     1550            size_t numSpansToReturn = (i > kMinSpanListsWithSpans) ? length : length / 2;
    15501551            for (int j = 0; static_cast<size_t>(j) < numSpansToReturn && !DLL_IsEmpty(&slist->normal) && free_committed_pages_ > targetPageCount; j++) {
    15511552                Span* s = slist->normal.prev;
Note: See TracChangeset for help on using the changeset viewer.