Bug 1073594 - Part 4: Remove nsTraceRefcntStats::mObjsOutstanding{Total, Squared}. r=dbaron, a=lizzard
authorAndrew McCreight <continuation@gmail.com>
Wed, 04 Mar 2015 14:07:59 -0800
changeset 248085 c2ab66bc0fdf999acce8844d094e5df0f69ff75c
parent 248084 d50b1d697c75e6f31b5ce05cac020734edb8fa0f
child 248086 1ca5e9fbc9fe8b64f0497bdd6abfa5e296291ad0
push id7757
push userryanvm@gmail.com
push dateFri, 13 Mar 2015 21:08:08 +0000
treeherdermozilla-aurora@e60410974749 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, lizzard
bugs1073594
milestone38.0a2
Bug 1073594 - Part 4: Remove nsTraceRefcntStats::mObjsOutstanding{Total, Squared}. r=dbaron, a=lizzard 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)