Bug 1289215 - Mismatched sizes assertion in nsTraceRefcnt.cpp should be fatal. r=froydnj
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -443,27 +443,22 @@ GetBloatEntry(const char* aTypeName, uin
entry = new BloatEntry(aTypeName, aInstanceSize);
PLHashEntry* e = PL_HashTableAdd(gBloatView, aTypeName, entry);
if (!e) {
delete entry;
entry = nullptr;
}
} else {
-#ifdef DEBUG
- static const char kMismatchedSizesMessage[] =
- "Mismatched sizes were recorded in the memory leak logging table. "
- "The usual cause of this is having a templated class that uses "
- "MOZ_COUNT_{C,D}TOR in the constructor or destructor, respectively. "
- "As a workaround, the MOZ_COUNT_{C,D}TOR calls can be moved to a "
- "non-templated base class.";
- NS_ASSERTION(aInstanceSize == 0 ||
- entry->GetClassSize() == aInstanceSize,
- kMismatchedSizesMessage);
-#endif // DEBUG
+ MOZ_ASSERT(aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize,
+ "Mismatched sizes were recorded in the memory leak logging table. "
+ "The usual cause of this is having a templated class that uses "
+ "MOZ_COUNT_{C,D}TOR in the constructor or destructor, respectively. "
+ "As a workaround, the MOZ_COUNT_{C,D}TOR calls can be moved to a "
+ "non-templated base class.");
}
}
return entry;
}
static int
DumpSerialNumbers(PLHashEntry* aHashEntry, int aIndex, void* aClosure)
{