Commit d7ab5fd4 authored by Mounir Lamouri's avatar Mounir Lamouri
Browse files

Bug 667887 - Implement nsMappedAttributes::SizeOf(). r=jst,bz

parent 210a9fc7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -108,6 +108,12 @@ public:
  virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
#endif

  PRInt64 SizeOf() const {
    NS_ASSERTION(mAttrCount == mBufferSize,
                 "mBufferSize and mAttrCount are expected to be the same.");
    return sizeof(*this) - sizeof(void*) + mAttrCount * sizeof(InternalAttr);
  }

private:
  nsMappedAttributes(const nsMappedAttributes& aCopy);
  ~nsMappedAttributes();
+1 −1
Original line number Diff line number Diff line
@@ -540,7 +540,7 @@ GetHashEntryAttributesSize(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
  PRInt64 size = *static_cast<PRInt64*>(aArg);

  NS_ASSERTION(entry->mAttributes, "entry->mAttributes should not be null!");
  size += sizeof(*entry->mAttributes);
  size += entry->mAttributes->SizeOf();

  return PL_DHASH_NEXT;
}