[Webkit-unassigned] [Bug 25930] Mismatched free

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 10 07:03:20 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25930


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #39346|review?                     |review+
               Flag|                            |




--- Comment #7 from Darin Adler <darin at apple.com>  2009-09-10 07:03:19 PDT ---
(From update of attachment 39346)
The name fastPureDelete isn't so clear. I think fastDeleteSkippingDestructor
would be better.

I think that "pure" is not a good term because it makes it sound like the other
delete is not as good as this one. It's this strange deletion without
destruction that needs the longer, uglier names.

> +    template <typename T>
> +    inline void fastPureDelete(T* p)

> -// Using WTF::FastAllocBase to avoid using FastAllocBase's explicit qualification by WTF::.
> +// Avoid explicit qualification by WTF::

I don't think there should be a comment here at all. The other WTF files don't
have a comment before their using statements.

> +    template<typename ValueType, typename HashTableType>
> +    void fastDeleteAllValues(HashTableType& collection)
> +    {
> +        typedef typename HashTableType::const_iterator iterator;
> +        iterator end = collection.end();
> +        for (iterator it = collection.begin(); it != end; ++it)
> +            fastDelete(*it);
> +    }
> +
> +    template<typename T, typename U, typename V>
> +    inline void fastDeleteAllValues(const HashSet<T, U, V>& collection)
> +    {
> +        fastDeleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);
> +    }

It's very sad to have two versions of this because we have two versions of
delete. In the end it's not scalable to have two of everything related to new
and delete.

r=me because my only quibble is with a function name

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list