Ignore:
Timestamp:
Apr 24, 2012, 12:11:12 PM (13 years ago)
Author:
[email protected]
Message:

"GlobalHandle" HandleHeap (now WeakSet) allocations grow but do not shrink
https://bugs.webkit.org/show_bug.cgi?id=84740
<rdar://problem/9917638>

Reviewed by Gavin Barraclough.

Shrink!

  • heap/Heap.cpp:

(JSC::Heap::destroy): Be more specific about what's shrinking, since we
can also shrink the WeakSet, but we don't do so here.

(JSC::Heap::collect): If we're going to shrink the heap, shrink the
WeakSet too. Otherwise, its footprint is permanent.

  • heap/Heap.h:

(Heap): Removed shrink() as a public interface, since it's vague about
which parts of the heap it affects, and it's really an internal detail.

  • heap/WeakSet.cpp:

(JSC::WeakSet::shrink): Nix any free blocks. We assume that sweep() has
already taken place, since that's the convention for shrink() in the heap.

  • heap/WeakSet.h:

(WeakSet): New function!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/WeakSet.cpp

    r114698 r115092  
    7474}
    7575
     76void WeakSet::shrink()
     77{
     78    WeakBlock* next;
     79    for (WeakBlock* block = static_cast<WeakBlock*>(m_blocks.head()); block; block = next) {
     80        next = static_cast<WeakBlock*>(block->next());
     81
     82        if (!block->sweepResult().isNull() && block->sweepResult().blockIsFree)
     83            removeAllocator(block);
     84    }
     85}
     86
    7687void WeakSet::resetAllocator()
    7788{
Note: See TracChangeset for help on using the changeset viewer.