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 331997 bd5e978762ce6e91f6431a81ce971ea551901c19
parent 331996 b807e09863ff0d989aa95f1d5176cb983b1d7789
child 331998 8830f07a659b22aa291704ff0eb8c42fd7368871
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1289215
milestone50.0a1
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)
 {