зеркало из https://github.com/mozilla/gecko-dev.git
Bug 667887 - Implement nsMappedAttributes::SizeOf(). r=jst,bz
This commit is contained in:
Родитель
083bf2d659
Коммит
6545d1886a
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче