From e623156ce991f5f0750ae9ef635cd78c1e110122 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Mon, 5 Mar 2007 21:07:51 +0000 Subject: [PATCH] Make nsCycleCollector::Fault do something in debug builds. b=372320 r=graydon sr=peterv git-svn-id: svn://10.0.0.236/trunk@221342 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/base/nsCycleCollector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/base/nsCycleCollector.cpp b/mozilla/xpcom/base/nsCycleCollector.cpp index acdef405cd9..5d2638f0bc4 100644 --- a/mozilla/xpcom/base/nsCycleCollector.cpp +++ b/mozilla/xpcom/base/nsCycleCollector.cpp @@ -134,6 +134,7 @@ #include "prprf.h" #include "plstr.h" #include "prtime.h" +#include "nsPrintfCString.h" #include #ifdef WIN32 @@ -591,6 +592,10 @@ Fault(const char *msg, const void *ptr=nsnull) } + NS_NOTREACHED(nsPrintfCString(256, + "Fault in cycle collector: %s (ptr: %p)\n", + msg, ptr).get()); + // When faults are not fatal, we assume we're running in a // production environment and we therefore want to disable the // collector on a fault. This will unfortunately cause the browser @@ -1396,7 +1401,7 @@ nsCycleCollector::RegisterRuntime(PRUint32 langID, Fault("unknown language runtime in registration"); if (mRuntimes[langID]) - Fault("multiple registrations of langauge runtime", rt); + Fault("multiple registrations of language runtime", rt); mRuntimes[langID] = rt; }