Ignore:
Timestamp:
May 7, 2006, 9:59:28 PM (19 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed and landed by Maciej.


I haven't figured out how to construct a test for this, but this does seem to fix the
problem; Mitz mentioned that a double-destroy was occurring in these functions.


  • kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also destroys the element based on the storage type. The RefCounter template correctly does work only in cases where ValueType and ValueStorageType differe and this class is what's used elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
  • kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.

WebCore:

Suggested by Mitz. Reviewed and landed by Maciej.


  • dom/Document.cpp: (WebCore::Document::formElementsState): Fixed mistake where the vector has an initial size and instead should have an initial capacity. Harmless in a way, but hurts performance.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kxmlcore/HashMap.h

    r14156 r14221  
    289289        if (it.m_impl == m_impl.end())
    290290            return;
    291         // Use "(*it)." instead of "it->" to work around a problem seen with the Visual C++ compiler.
    292         (*it).~ValueType();
     291        RefCounter<ValueTraits, ValueStorageTraits>::deref(*it.m_impl);
    293292        m_impl.remove(it.m_impl);
    294293    }
Note: See TracChangeset for help on using the changeset viewer.