Changeset 40561 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Feb 3, 2009, 5:52:34 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-03 David Hyatt <[email protected]>

Fix a bug in Vector's shrinkCapacity method. It did not properly copy elements into the inline buffer
when shrinking down from a size that was greater than the inline capacity.

Reviewed by Maciej

  • wtf/Vector.h: (WTF::VectorBuffer::VectorBuffer): (WTF::VectorBuffer::allocateBuffer):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r40536 r40561  
     12009-02-03  David Hyatt  <[email protected]>
     2
     3        Fix a bug in Vector's shrinkCapacity method.  It did not properly copy elements into the inline buffer
     4        when shrinking down from a size that was greater than the inline capacity.
     5
     6        Reviewed by Maciej
     7
     8        * wtf/Vector.h:
     9        (WTF::VectorBuffer::VectorBuffer):
     10        (WTF::VectorBuffer::allocateBuffer):
     11
    1122009-02-03  Simon Hausmann  <[email protected]>
    213
  • trunk/JavaScriptCore/wtf/Vector.h

    r40501 r40561  
    378378            : Base(inlineBuffer(), inlineCapacity)
    379379        {
    380             allocateBuffer(capacity);
     380            if (capacity > inlineCapacity)
     381                Base::allocateBuffer(capacity);
    381382        }
    382383
     
    390391            if (newCapacity > inlineCapacity)
    391392                Base::allocateBuffer(newCapacity);
     393            else {
     394                m_buffer = inlineBuffer();
     395                m_capacity = inlineCapacity;
     396            }
    392397        }
    393398
Note: See TracChangeset for help on using the changeset viewer.