Bug 1229458 - Remove SizeOfIncludingThisMustBeUnshared() from string classes. r=mccr8.
The patch changes all uses of SizeOfIncludingThisMustBeUnshared() to SizeOfIncludingThisIfUnshared(). This incurs the (tiny) cost of an unnecessary IsReadonly() check for guaranteed-unshared strings, but avoids the possible assertion failures that would occur when MustBeUnshared() was used incorrectly on shared strings, which is an easy mistake to make.
This commit is contained in:
@@ -1846,7 +1846,7 @@ nsComponentManagerImpl::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
for (auto iter = mContractIDs.ConstIter(); !iter.Done(); iter.Next()) {
|
||||
// We don't measure the nsFactoryEntry data because it's owned by
|
||||
// mFactories (which is measured above).
|
||||
n += iter.Key().SizeOfExcludingThisMustBeUnshared(aMallocSizeOf);
|
||||
n += iter.Key().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
}
|
||||
|
||||
n += sStaticModules->ShallowSizeOfIncludingThis(aMallocSizeOf);
|
||||
|
||||
Reference in New Issue
Block a user