Bug 1289215 - Mismatched sizes assertion in nsTraceRefcnt.cpp should be fatal. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Wed, 27 Jul 2016 10:11:40 -0700
changeset 346963 bd5e978762ce6e91f6431a81ce971ea551901c19
parent 346962 b807e09863ff0d989aa95f1d5176cb983b1d7789
child 346964 8830f07a659b22aa291704ff0eb8c42fd7368871
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1289215
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1289215 - Mismatched sizes assertion in nsTraceRefcnt.cpp should be fatal. r=froydnj
xpcom/base/nsTraceRefcnt.cpp
--- 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)
 {