Bug 1073594, part 4 - Remove nsTraceRefcntStats::mObjsOutstanding{Total, Squared}. r=dbaron
authorAndrew McCreight <continuation@gmail.com>
Wed, 04 Mar 2015 14:07:59 -0800
changeset 231925 505dc97789f0f5658866c8dadafa31b42d9875d0
parent 231924 ac6e3fccc155442c12875b856e48e0c9e4bcb094
child 231926 1d9cead20b3c520e8942869ad608d56f4d3dfd51
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs1073594
milestone39.0a1
Bug 1073594, part 4 - Remove nsTraceRefcntStats::mObjsOutstanding{Total, Squared}. r=dbaron They are now unused.
xpcom/base/nsTraceRefcnt.cpp
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -89,18 +89,16 @@ struct serialNumberRecord
 };
 
 struct nsTraceRefcntStats
 {
   uint64_t mAddRefs;
   uint64_t mReleases;
   uint64_t mCreates;
   uint64_t mDestroys;
-  double mObjsOutstandingTotal;
-  double mObjsOutstandingSquared;
 };
 
 #ifdef DEBUG
 static const char kStaticCtorDtorWarning[] =
   "XPCOM objects created/destroyed from static ctor/dtor";
 
 static void
 AssertActivityIsLegal()
@@ -248,28 +246,24 @@ public:
   }
 
   static void Clear(nsTraceRefcntStats* aStats)
   {
     aStats->mAddRefs = 0;
     aStats->mReleases = 0;
     aStats->mCreates = 0;
     aStats->mDestroys = 0;
-    aStats->mObjsOutstandingTotal = 0;
-    aStats->mObjsOutstandingSquared = 0;
   }
 
   void Accumulate()
   {
     mAllStats.mAddRefs += mNewStats.mAddRefs;
     mAllStats.mReleases += mNewStats.mReleases;
     mAllStats.mCreates += mNewStats.mCreates;
     mAllStats.mDestroys += mNewStats.mDestroys;
-    mAllStats.mObjsOutstandingTotal += mNewStats.mObjsOutstandingTotal;
-    mAllStats.mObjsOutstandingSquared += mNewStats.mObjsOutstandingSquared;
     Clear(&mNewStats);
   }
 
   void AddRef(nsrefcnt aRefcnt)
   {
     mNewStats.mAddRefs++;
     if (aRefcnt == 1) {
       Ctor();
@@ -282,30 +276,21 @@ public:
     if (aRefcnt == 0) {
       Dtor();
     }
   }
 
   void Ctor()
   {
     mNewStats.mCreates++;
-    AccountObjs();
   }
 
   void Dtor()
   {
     mNewStats.mDestroys++;
-    AccountObjs();
-  }
-
-  void AccountObjs()
-  {
-    uint64_t cnt = (mNewStats.mCreates - mNewStats.mDestroys);
-    mNewStats.mObjsOutstandingTotal += cnt;
-    mNewStats.mObjsOutstandingSquared += cnt * cnt;
   }
 
   static int DumpEntry(PLHashEntry* aHashEntry, int aIndex, void* aArg)
   {
     BloatEntry* entry = (BloatEntry*)aHashEntry->value;
     if (entry) {
       entry->Accumulate();
       static_cast<nsTArray<BloatEntry*>*>(aArg)->AppendElement(entry);
@@ -323,20 +308,16 @@ public:
   }
 
   void Total(BloatEntry* aTotal)
   {
     aTotal->mAllStats.mAddRefs += mNewStats.mAddRefs + mAllStats.mAddRefs;
     aTotal->mAllStats.mReleases += mNewStats.mReleases + mAllStats.mReleases;
     aTotal->mAllStats.mCreates += mNewStats.mCreates + mAllStats.mCreates;
     aTotal->mAllStats.mDestroys += mNewStats.mDestroys + mAllStats.mDestroys;
-    aTotal->mAllStats.mObjsOutstandingTotal +=
-      mNewStats.mObjsOutstandingTotal + mAllStats.mObjsOutstandingTotal;
-    aTotal->mAllStats.mObjsOutstandingSquared +=
-      mNewStats.mObjsOutstandingSquared + mAllStats.mObjsOutstandingSquared;
     uint64_t count = (mNewStats.mCreates + mAllStats.mCreates);
     aTotal->mClassSize += mClassSize * count;    // adjust for average in DumpTotal
     aTotal->mTotalLeaked += (uint64_t)(mClassSize *
                                        ((mNewStats.mCreates + mAllStats.mCreates)
                                         - (mNewStats.mDestroys + mAllStats.mDestroys)));
   }
 
   void DumpTotal(FILE* aOut)