Ignore:
Timestamp:
Mar 19, 2009, 10:57:01 PM (16 years ago)
Author:
[email protected]
Message:

2009-03-19 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Fixed <rdar://problem/6033712> -- a little bit of hardening in the Collector.


SunSpider reports no change. I also verified in the disassembly that
we end up with a single compare to constant.

  • runtime/Collector.cpp: (JSC::Heap::heapAllocate):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r40169 r41854  
    350350        size_t numBlocks = heap.numBlocks;
    351351        if (usedBlocks == numBlocks) {
     352            static const size_t maxNumBlocks = ULONG_MAX / sizeof(CollectorBlock*) / GROWTH_FACTOR;
     353            if (numBlocks > maxNumBlocks)
     354                CRASH();
    352355            numBlocks = max(MIN_ARRAY_SIZE, numBlocks * GROWTH_FACTOR);
    353356            heap.numBlocks = numBlocks;
Note: See TracChangeset for help on using the changeset viewer.