Bug 676314: Count RuleHash's mArena in about:memory. r=bz
authorKyle Huey <khuey@kylehuey.com>
Mon, 08 Aug 2011 08:36:38 -0400
changeset 74180 63c1f6f5ee0352e646703e5316bcd34ee59134ca
parent 74179 e1bc7f08fa696189fc939cfef235d126373ae431
child 74181 4aa92c4a5f135cf1ebbc5f327d0a3e884482f896
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersbz
bugs676314
milestone8.0a1
Bug 676314: Count RuleHash's mArena in about:memory. r=bz
layout/style/nsCSSRuleProcessor.cpp
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -733,16 +733,22 @@ RuleHash::SizeOf() const
                          RuleHashTableSizeOfEnumerator, &n);
 
   n += PL_DHASH_TABLE_SIZE(&mNameSpaceTable) * sizeof(RuleHashTableEntry);
   PL_DHashTableEnumerate(const_cast<PLDHashTable*>(&mNameSpaceTable),
                          RuleHashTableSizeOfEnumerator, &n);
 
   n += mUniversalRules.SizeOf();
 
+  const PLArena* current = &mArena.first;
+  while (current) {
+    n += current->limit - current->base;
+    current = current->next;
+  }
+
   return n;
 }
 
 //--------------------------------
 
 // A hash table mapping atoms to lists of selectors
 struct AtomSelectorEntry : public PLDHashEntryHdr {
   nsIAtom *mAtom;