Bug 1424834 - LinkedList::sizeOfExcludingThis should use ConstRawType instead of T* r=njn
☠☠ backed out by 5572465c08a9 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 15 Dec 2017 15:46:31 -0600
changeset 396641 2503df83bbd9
parent 396640 49cc08386f17
child 396642 b077139a7216
push id33104
push usernerli@mozilla.com
push date2017-12-17 21:43 +0000
treeherdermozilla-central@e3048146437d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1424834
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1424834 - LinkedList::sizeOfExcludingThis should use ConstRawType instead of T* r=njn MozReview-Commit-ID: 2EM9cEOAkIl
mfbt/LinkedList.h
netwerk/dns/nsHostResolver.cpp
--- 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.sizeOfIncludingThis(mallocSizeOf);
 
     for (const nsResolveHostCallback* t = aCallbacks.getFirst(); t; t = t->getNext()) {
       n += t->SizeOfIncludingThis(mallocSizeOf);
     }
 
     return n;
 }