Bug 1424834 - LinkedList::sizeOfExcludingThis should use ConstRawType instead of T* r=njn
☠☠ backed out by 048f69ab51e2 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 15 Dec 2017 15:46:31 -0600
changeset 448542 00e1d58aedfe4d25a8a5f27a3db579a60dab5bba
parent 448541 9b69f2b7d37346a5ac8aff8aeec2fe23673fe566
child 448543 966836866e8afe423a01a9926834a26cb3d3e2b0
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [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;
 }