Ignore:
Timestamp:
Jan 18, 2013, 12:49:58 PM (12 years ago)
Author:
[email protected]
Message:

r134080 causes heap problem on linux systems where PAGESIZE != 4096
https://bugs.webkit.org/show_bug.cgi?id=102828

Patch by Balazs Kilvady <[email protected]> on 2013-01-18
Reviewed by Mark Hahnenberg.

Make MarkStackSegment::blockSize as the capacity of segments of a MarkStackArray.

  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
  • heap/MarkStack.cpp:

(JSC):
(JSC::MarkStackArray::MarkStackArray):
(JSC::MarkStackArray::expand):
(JSC::MarkStackArray::donateSomeCellsTo):
(JSC::MarkStackArray::stealSomeCellsFrom):

  • heap/MarkStack.h:

(JSC::MarkStackSegment::data):
(CapacityFromSize):
(MarkStackArray):

  • heap/MarkStackInlines.h:

(JSC::MarkStackArray::setTopForFullSegment):
(JSC::MarkStackArray::append):
(JSC::MarkStackArray::isEmpty):
(JSC::MarkStackArray::size):

  • runtime/Options.h:

(JSC):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStack.h

    r135469 r140195  
    7676        return bitwise_cast<const JSCell**>(this + 1);
    7777    }
    78    
    79     static size_t capacityFromSize(size_t size)
    80     {
    81         return (size - sizeof(MarkStackSegment)) / sizeof(const JSCell*);
    82     }
    83    
    84     static size_t sizeFromCapacity(size_t capacity)
    85     {
    86         return sizeof(MarkStackSegment) + capacity * sizeof(const JSCell*);
    87     }
    8878
    8979    static const size_t blockSize = 4 * KB;
     
    112102
    113103private:
     104    template <size_t size> struct CapacityFromSize {
     105        static const size_t value = (size - sizeof(MarkStackSegment)) / sizeof(const JSCell*);
     106    };
     107
    114108    JS_EXPORT_PRIVATE void expand();
    115109   
     
    125119    BlockAllocator& m_blockAllocator;
    126120
    127     size_t m_segmentCapacity;
     121    JS_EXPORT_PRIVATE static const size_t s_segmentCapacity = CapacityFromSize<MarkStackSegment::blockSize>::value;
    128122    size_t m_top;
    129123    size_t m_numberOfSegments;
Note: See TracChangeset for help on using the changeset viewer.