A HashMap<RetainPtr<NSObject>, ValueType> uses pointer hashing and pointer equality rather than -hash and -isEqual:.
Created attachment 188429 [details] Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=188429&action=review > Source/WTF/wtf/RetainPtr.h:310 > + static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(AdoptCF, reinterpret_cast<P *>(-1)); } > + static bool isDeletedValue(const RetainPtr<P>& value) { return value.get() == reinterpret_cast<P *>(-1); } I would prefer something using an explicit constructor, like we do in RefPtr.
(In reply to comment #2) > View in context: https://bugs.webkit.org/attachment.cgi?id=188429&action=review > > > Source/WTF/wtf/RetainPtr.h:310 > > + static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(AdoptCF, reinterpret_cast<P *>(-1)); } > > + static bool isDeletedValue(const RetainPtr<P>& value) { return value.get() == reinterpret_cast<P *>(-1); } > > I would prefer something using an explicit constructor, like we do in RefPtr. Done! Fixed in <http://trac.webkit.org/r142924>.