mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1245393 - Measure s{,Default}RootBranch in the Preferences memory reporter. r=froydnj.
This commit is contained in:
parent
830a6d5631
commit
9fed28582d
@ -245,8 +245,12 @@ Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeO
|
||||
n += iter.Data()->mClosures.ShallowSizeOfExcludingThis(aMallocSizeOf);
|
||||
}
|
||||
}
|
||||
// We don't measure sRootBranch and sDefaultRootBranch here because
|
||||
// DMD indicates they are not significant.
|
||||
if (sRootBranch) {
|
||||
n += reinterpret_cast<nsPrefBranch*>(sRootBranch)->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
if (sDefaultRootBranch) {
|
||||
n += reinterpret_cast<nsPrefBranch*>(sDefaultRootBranch)->SizeOfIncludingThis(aMallocSizeOf);
|
||||
}
|
||||
n += pref_SizeOfPrivateData(aMallocSizeOf);
|
||||
return n;
|
||||
}
|
||||
|
@ -687,6 +687,15 @@ void nsPrefBranch::NotifyObserver(const char *newpref, void *data)
|
||||
NS_ConvertASCIItoUTF16(suffix).get());
|
||||
}
|
||||
|
||||
size_t
|
||||
nsPrefBranch::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
size_t n = aMallocSizeOf(this);
|
||||
n += mPrefRoot.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||
n += mObservers.ShallowSizeOfExcludingThis(aMallocSizeOf);
|
||||
return n;
|
||||
}
|
||||
|
||||
void nsPrefBranch::freeObserverList(void)
|
||||
{
|
||||
// We need to prevent anyone from modifying mObservers while we're iterating
|
||||
|
Loading…
Reference in New Issue
Block a user