Bug 822700 - When DMD is disabled its SizeOf() function shouldn't try to measure non-existent structures. r=jlebar.

--HG--
extra : rebase_source : 21066e5173dbc7e4a6c7615f1b355989bf046082
This commit is contained in:
Nicholas Nethercote 2012-12-18 15:14:31 -08:00
parent 23a8027808
commit 023fca81d9
2 changed files with 7 additions and 1 deletions

View File

@ -1973,6 +1973,11 @@ PrintSortedBlockAndFrameGroups(const Writer& aWriter,
MOZ_EXPORT void
SizeOf(Sizes* aSizes)
{
if (!gIsDMDRunning) {
aSizes->Clear();
return;
}
aSizes->mStackTraces = 0;
for (StackTraceTable::Range r = gStackTraceTable->all();
!r.empty();

View File

@ -57,7 +57,8 @@ struct Sizes
size_t mLiveBlockTable;
size_t mDoubleReportTable;
Sizes() { memset(this, 0, sizeof(Sizes)); }
Sizes() { Clear(); }
void Clear() { memset(this, 0, sizeof(Sizes)); }
};
// Gets the size of various data structures. Used to implement a memory