Ignore:
Timestamp:
Aug 3, 2010, 2:29:32 PM (15 years ago)
Author:
[email protected]
Message:

Change to keep returned pointer from malloc family functions to
quiet memory leak detect. The pointer is saved in the new m_allocBase
member of the ArrayStorage structure. This fixes the issue found in
https://bugs.webkit.org/show_bug.cgi?id=43229.

Patch by Michael Saboff <[email protected]> on 2010-08-03
Reviewed by Gavin Barraclough.

As part of this change, we use m_allocBase when reallocating and
freeing the memory associated with ArrayStorage.

  • runtime/JSArray.cpp:

(JSC::JSArray::JSArray):
(JSC::JSArray::~JSArray):
(JSC::JSArray::putSlowCase):
(JSC::JSArray::increaseVectorLength):
(JSC::JSArray::increaseVectorPrefixLength):

  • runtime/JSArray.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSArray.h

    r64320 r64588  
    4040        SparseArrayValueMap* m_sparseValueMap;
    4141        void* subclassData; // A JSArray subclass can use this to fill the vector lazily.
     42        void* m_allocBase; // Pointer to base address returned by malloc().  Keeping this pointer does eliminate false positives from the leak detector.
    4243        size_t reportedMapCapacity;
    4344#if CHECK_ARRAY_CONSISTENCY
Note: See TracChangeset for help on using the changeset viewer.