From 6691a673f47223b5d3ffc4e38e15c8acfedf3f5a Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Fri, 26 Feb 2016 15:52:08 +0000 Subject: [PATCH] Bug 1253094, part 9 - Stop using DebugOnly for class/struct members in xpcom/. r=froydnj MozReview-Commit-ID: ACYMR37DGU9 --- xpcom/base/nsCycleCollector.cpp | 10 ++++++++-- xpcom/base/nsMemoryInfoDumper.cpp | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index c20581e42e02..7055a09e842b 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -1275,7 +1275,9 @@ private: nsAutoPtr mBuilder; RefPtr mLogger; - DebugOnly mThread; +#ifdef DEBUG + void* mThread; +#endif nsCycleCollectorParams mParams; @@ -3402,7 +3404,9 @@ nsCycleCollector::nsCycleCollector() : mScanInProgress(false), mJSRuntime(nullptr), mIncrementalPhase(IdlePhase), +#ifdef DEBUG mThread(NS_GetCurrentThread()), +#endif mWhiteNodeCount(0), mBeforeUnlinkCB(nullptr), mForgetSkippableCB(nullptr), @@ -4025,11 +4029,13 @@ nsCycleCollector_suspectedCount() bool nsCycleCollector_init() { - static DebugOnly sInitialized; +#ifdef DEBUG + static bool sInitialized; MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); MOZ_ASSERT(!sInitialized, "Called twice!?"); sInitialized = true; +#endif return sCollectorData.init(); } diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index 9d84f47a6cb1..0983990e6a28 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -222,7 +222,9 @@ doGCCCDump(const nsCString& aInputStr) bool SetupFifo() { - static DebugOnly fifoCallbacksRegistered = false; +#ifdef DEBUG + static bool fifoCallbacksRegistered = false; +#endif if (!FifoWatcher::MaybeCreate()) { return false; @@ -243,7 +245,9 @@ SetupFifo() fw->RegisterCallback(NS_LITERAL_CSTRING("abbreviated gc log"), doGCCCDump); +#ifdef DEBUG fifoCallbacksRegistered = true; +#endif return true; }