Bug 1026985 - Stop reporting the memory use of nsAttrValue's MiscContainer objects if they are shared between more than one nsAttrValue. r=bz

This commit is contained in:
Jonathan Watt 2014-06-19 10:14:41 +01:00
parent 8d59b9aa4e
commit 7803ef55ff

View File

@ -1968,6 +1968,13 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
if (!container) {
break;
}
if (container->IsRefCounted() && container->mValue.mRefCount > 1) {
// We don't report this MiscContainer at all in order to avoid
// twice-reporting it.
// TODO DMD, bug 1027551 - figure out how to report this ref-counted
// object just once.
break;
}
n += aMallocSizeOf(container);
void* otherPtr = MISC_STR_PTR(container);