Bug 1424834 - LinkedList::sizeOfExcludingThis should use ConstRawType instead of T* r=nnethercote
MozReview-Commit-ID: 2EM9cEOAkIl
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -546,17 +546,17 @@ public:
* Measures the memory consumption of the list excluding |this|. Note that
* it only measures the list elements themselves. If the list elements
* contain pointers to other memory blocks, those blocks must be measured
* separately during a subsequent iteration over the list.
*/
size_t sizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = 0;
- for (const T* t = getFirst(); t; t = t->getNext()) {
+ for (ConstRawType t = getFirst(); t; t = t->getNext()) {
n += aMallocSizeOf(t);
}
return n;
}
/*
* Like sizeOfExcludingThis(), but measures |this| as well.
*/
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -325,17 +325,17 @@ nsHostRecord::HasUsableResult(const mozi
return addr_info || addr || negative;
}
static size_t
SizeOfResolveHostCallbackListExcludingHead(const mozilla::LinkedList<RefPtr<nsResolveHostCallback>>& aCallbacks,
MallocSizeOf mallocSizeOf)
{
- size_t n = 0; // TODO: should be aCallbacks.sizeOfIncludingThis(mallocSizeOf);
+ size_t n = aCallbacks.sizeOfExcludingThis(mallocSizeOf);
for (const nsResolveHostCallback* t = aCallbacks.getFirst(); t; t = t->getNext()) {
n += t->SizeOfIncludingThis(mallocSizeOf);
}
return n;
}