Bug 1586744 - Explicitly track StartupCache table's memory r=njn

This was not being fully tracked as a result of bug 1550108.

Differential Revision: https://phabricator.services.mozilla.com/D49017

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Doug Thayer 2019-10-16 15:41:54 +00:00
parent c24a0fbe31
commit 8ef17f5f9f

View File

@ -454,6 +454,12 @@ size_t StartupCache::HeapSizeOfIncludingThis(
size_t n = aMallocSizeOf(this);
n += mTable.shallowSizeOfExcludingThis(aMallocSizeOf);
for (auto iter = mTable.iter(); !iter.done(); iter.next()) {
if (iter.get().value().mData) {
n += aMallocSizeOf(iter.get().value().mData.get());
}
n += iter.get().key().SizeOfExcludingThisIfUnshared(aMallocSizeOf);
}
return n;
}