From 91f3c0c4ecc24b865ad4fc6c12d4b9c067bc71f7 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Sun, 6 May 2001 02:27:33 +0000 Subject: [PATCH] Bug 77209. Get rid of unused module instance counting in order to eliminate duplicate global symbols. r=erik, sr=shaver --- intl/chardet/src/classic/nsClassicCharDetDll.cpp | 4 ---- intl/chardet/src/classic/nsClassicCharDetDll.h | 3 --- intl/chardet/src/classic/nsClassicDetectors.cpp | 4 ---- intl/chardet/src/nsCharDetDll.h | 6 ------ intl/chardet/src/nsCharDetModule.cpp | 3 --- intl/chardet/src/nsCyrillicDetector.cpp | 4 ---- intl/chardet/src/nsDebugDetector.cpp | 2 -- intl/chardet/src/nsDetectionAdaptor.cpp | 2 -- intl/chardet/src/nsDetectionAdaptor.h | 4 ---- intl/chardet/src/nsDocumentCharsetInfo.cpp | 2 -- intl/chardet/src/nsMetaCharsetObserver.cpp | 2 -- intl/chardet/src/nsPSMDetectors.cpp | 4 ---- intl/chardet/src/nsXMLEncodingObserver.cpp | 3 --- intl/chardet/src/windows/nsNativeCharDetDll.cpp | 6 +----- intl/chardet/src/windows/nsNativeCharDetDll.h | 3 --- intl/chardet/src/windows/nsNativeDetectors.cpp | 10 ---------- intl/lwbrk/src/nsJISx4501LineBreaker.cpp | 2 -- intl/lwbrk/src/nsLWBRKDll.h | 6 ------ intl/lwbrk/src/nsLWBreakerFImp.cpp | 2 -- intl/lwbrk/src/nsLWBrkModule.cpp | 3 --- intl/lwbrk/src/nsSampleWordBreaker.cpp | 2 -- intl/uconv/src/nsCharsetAliasImp.cpp | 2 -- intl/uconv/src/nsCharsetConverterManager.cpp | 2 -- intl/uconv/src/nsCharsetMenu.cpp | 3 --- intl/uconv/src/nsMacCharset.cpp | 2 -- intl/uconv/src/nsOS2Charset.cpp | 8 -------- intl/uconv/src/nsTextToSubURI.cpp | 2 -- intl/uconv/src/nsUConvDll.cpp | 2 +- intl/uconv/src/nsUConvDll.h | 3 --- intl/uconv/src/nsUConvModule.cpp | 5 ----- intl/uconv/src/nsUCvMinDll.h | 3 --- intl/uconv/src/nsUCvMinSupport.cpp | 4 ---- intl/uconv/src/nsUNIXCharset.cpp | 2 -- intl/uconv/src/nsUnicodeDecodeHelper.cpp | 2 -- intl/uconv/src/nsUnicodeEncodeHelper.cpp | 2 -- intl/uconv/src/nsWinCharset.cpp | 2 -- intl/uconv/ucvcn/nsUCvCnDll.h | 3 --- intl/uconv/ucvcn/nsUCvCnSupport.cpp | 4 ---- intl/uconv/ucvibm/nsUCvIBMDll.h | 3 --- intl/uconv/ucvibm/nsUCvIBMSupport.cpp | 4 ---- intl/uconv/ucvja/nsUCVJADll.h | 2 -- intl/uconv/ucvja/nsUCvJaSupport.cpp | 4 ---- intl/uconv/ucvko/nsUCvKODll.h | 4 ---- intl/uconv/ucvko/nsUCvKOSupport.cpp | 4 ---- intl/uconv/ucvko/nsUnicodeToX11Johab.cpp | 2 -- intl/uconv/ucvlatin/nsUCvLatinDll.h | 3 --- intl/uconv/ucvlatin/nsUCvLatinSupport.cpp | 4 ---- intl/uconv/ucvmath/nsUCvMathDll.h | 3 --- intl/uconv/ucvmath/nsUCvMathSupport.cpp | 4 ---- intl/uconv/ucvtw/nsUCvTWDll.h | 2 -- intl/uconv/ucvtw/nsUCvTWSupport.cpp | 4 ---- intl/uconv/ucvtw2/nsUCvTW2Dll.h | 3 --- intl/uconv/ucvtw2/nsUCvTW2Support.cpp | 4 ---- intl/unicharutil/src/nsBidiImp.cpp | 2 -- intl/unicharutil/src/nsBidiUtilsImp.cpp | 2 -- intl/unicharutil/src/nsCaseConversionImp2.cpp | 2 -- intl/unicharutil/src/nsCategoryImp.cpp | 2 -- intl/unicharutil/src/nsCharsOrderIdFormater.cpp | 8 -------- intl/unicharutil/src/nsHankakuToZenkaku.cpp | 2 -- intl/unicharutil/src/nsUUDll.h | 6 ------ intl/unicharutil/src/nsUcharUtilModule.cpp | 3 --- 61 files changed, 2 insertions(+), 203 deletions(-) diff --git a/intl/chardet/src/classic/nsClassicCharDetDll.cpp b/intl/chardet/src/classic/nsClassicCharDetDll.cpp index e986f4f4209..46eb9eb3361 100644 --- a/intl/chardet/src/classic/nsClassicCharDetDll.cpp +++ b/intl/chardet/src/classic/nsClassicCharDetDll.cpp @@ -44,10 +44,6 @@ static NS_DEFINE_CID(kJAClassicStringDetectorCID, NS_JA_CLASSIC_STRING_DETECTO static NS_DEFINE_CID(kKOClassicDetectorCID, NS_KO_CLASSIC_DETECTOR_CID); static NS_DEFINE_CID(kKOClassicStringDetectorCID, NS_KO_CLASSIC_STRING_DETECTOR_CID); -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - - NS_GENERIC_FACTORY_CONSTRUCTOR(nsJACharsetClassicDetector); NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAStringCharsetClassicDetector); NS_GENERIC_FACTORY_CONSTRUCTOR(nsKOCharsetClassicDetector); diff --git a/intl/chardet/src/classic/nsClassicCharDetDll.h b/intl/chardet/src/classic/nsClassicCharDetDll.h index 66992a31e99..dbd396c4c2a 100644 --- a/intl/chardet/src/classic/nsClassicCharDetDll.h +++ b/intl/chardet/src/classic/nsClassicCharDetDll.h @@ -25,7 +25,4 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #endif /* nsClassicCharDetDll_h__ */ diff --git a/intl/chardet/src/classic/nsClassicDetectors.cpp b/intl/chardet/src/classic/nsClassicDetectors.cpp index 223200114e6..88f0d30efcd 100644 --- a/intl/chardet/src/classic/nsClassicDetectors.cpp +++ b/intl/chardet/src/classic/nsClassicDetectors.cpp @@ -205,12 +205,10 @@ nsClassicDetector::nsClassicDetector(const char* language) NS_INIT_REFCNT(); mObserver = nsnull; PL_strcpy(mLanguage, language); - PR_AtomicIncrement(&g_InstanceCount); } //---------------------------------------------------------- nsClassicDetector::~nsClassicDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- NS_IMETHODIMP nsClassicDetector::Init( @@ -261,12 +259,10 @@ nsClassicStringDetector::nsClassicStringDetector(const char* language) { NS_INIT_REFCNT(); PL_strcpy(mLanguage, language); - PR_AtomicIncrement(&g_InstanceCount); } //---------------------------------------------------------- nsClassicStringDetector::~nsClassicStringDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- diff --git a/intl/chardet/src/nsCharDetDll.h b/intl/chardet/src/nsCharDetDll.h index 4a0b276641b..ceb917a709a 100644 --- a/intl/chardet/src/nsCharDetDll.h +++ b/intl/chardet/src/nsCharDetDll.h @@ -30,10 +30,4 @@ #include "nsIStringCharsetDetector.h" #include "nsICharsetDetectionAdaptor.h" -#define g_InstanceCount nsCharDetModule_g_InstanceCount -#define g_LockCount nsCharDetModule_g_LockCount - -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #endif /* nsCharDetDll_h__ */ diff --git a/intl/chardet/src/nsCharDetModule.cpp b/intl/chardet/src/nsCharDetModule.cpp index 63774833476..baedde58ca1 100644 --- a/intl/chardet/src/nsCharDetModule.cpp +++ b/intl/chardet/src/nsCharDetModule.cpp @@ -52,9 +52,6 @@ #include "nsCharsetDetectionAdaptorCID.h" #include "nsDocumentCharsetInfoCID.h" -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - //#define INCLUDE_DBGDETECTOR #ifdef INCLUDE_DBGDETECTOR // for debuging only diff --git a/intl/chardet/src/nsCyrillicDetector.cpp b/intl/chardet/src/nsCyrillicDetector.cpp index 8eb794a789f..340901474f9 100644 --- a/intl/chardet/src/nsCyrillicDetector.cpp +++ b/intl/chardet/src/nsCyrillicDetector.cpp @@ -94,14 +94,12 @@ nsCyrXPCOMDetector:: nsCyrXPCOMDetector(PRUint8 aItems, : nsCyrillicDetector(aItems, aCyrillicClass, aCharsets) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); mObserver = nsnull; } //--------------------------------------------------------------------- nsCyrXPCOMDetector::~nsCyrXPCOMDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //--------------------------------------------------------------------- @@ -152,13 +150,11 @@ nsCyrXPCOMStringDetector:: nsCyrXPCOMStringDetector(PRUint8 aItems, : nsCyrillicDetector(aItems, aCyrillicClass, aCharsets) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } //--------------------------------------------------------------------- nsCyrXPCOMStringDetector::~nsCyrXPCOMStringDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //--------------------------------------------------------------------- diff --git a/intl/chardet/src/nsDebugDetector.cpp b/intl/chardet/src/nsDebugDetector.cpp index 7fff32d1e94..0a141110bb7 100644 --- a/intl/chardet/src/nsDebugDetector.cpp +++ b/intl/chardet/src/nsDebugDetector.cpp @@ -37,12 +37,10 @@ nsDebugDetector::nsDebugDetector( nsDebugDetectorSel aSel) mObserver = nsnull; mStop = PR_FALSE; NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } //-------------------------------------------------------------------- nsDebugDetector::~nsDebugDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //-------------------------------------------------------------------- NS_IMETHODIMP nsDebugDetector::Init(nsICharsetDetectionObserver* aObserver) diff --git a/intl/chardet/src/nsDetectionAdaptor.cpp b/intl/chardet/src/nsDetectionAdaptor.cpp index 2ee7758c951..526eadce1a3 100644 --- a/intl/chardet/src/nsDetectionAdaptor.cpp +++ b/intl/chardet/src/nsDetectionAdaptor.cpp @@ -86,13 +86,11 @@ NS_IMPL_ISUPPORTS1 ( nsMyObserver ,nsICharsetDetectionObserver); nsDetectionAdaptor::nsDetectionAdaptor( void ) { NS_INIT_REFCNT(); - PR_AtomicIncrement(& g_InstanceCount); mDontFeedToDetector = PR_TRUE; } //-------------------------------------------------------------- nsDetectionAdaptor::~nsDetectionAdaptor() { - PR_AtomicDecrement(& g_InstanceCount); } //-------------------------------------------------------------- diff --git a/intl/chardet/src/nsDetectionAdaptor.h b/intl/chardet/src/nsDetectionAdaptor.h index e38cb5b6d7a..58a41cde588 100644 --- a/intl/chardet/src/nsDetectionAdaptor.h +++ b/intl/chardet/src/nsDetectionAdaptor.h @@ -30,8 +30,6 @@ static NS_DEFINE_IID(kIParserFilterIID, NS_IPARSERFILTER_IID); class CToken; -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; //-------------------------------------------------------------- class nsMyObserver : public nsICharsetDetectionObserver @@ -43,7 +41,6 @@ class nsMyObserver : public nsICharsetDetectionObserver nsMyObserver( void ) { NS_INIT_REFCNT(); - PR_AtomicIncrement(& g_InstanceCount); mWebShellSvc = nsnull; mNotifyByReload = PR_FALSE; mWeakRefDocument = nsnull; @@ -51,7 +48,6 @@ class nsMyObserver : public nsICharsetDetectionObserver } virtual ~nsMyObserver( void ) { - PR_AtomicDecrement(& g_InstanceCount); // do not release nor delete mWeakRefDocument // do not release nor delete mWeakRefParser } diff --git a/intl/chardet/src/nsDocumentCharsetInfo.cpp b/intl/chardet/src/nsDocumentCharsetInfo.cpp index acaa84c6b0a..9e7f5ffe648 100644 --- a/intl/chardet/src/nsDocumentCharsetInfo.cpp +++ b/intl/chardet/src/nsDocumentCharsetInfo.cpp @@ -36,12 +36,10 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsDocumentCharsetInfo, nsIDocumentCharsetInfo); nsDocumentCharsetInfo::nsDocumentCharsetInfo() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsDocumentCharsetInfo::~nsDocumentCharsetInfo() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHODIMP nsDocumentCharsetInfo::SetForcedCharset(nsIAtom * aCharset) diff --git a/intl/chardet/src/nsMetaCharsetObserver.cpp b/intl/chardet/src/nsMetaCharsetObserver.cpp index 9648cc2bdc4..5cad1c65dcc 100644 --- a/intl/chardet/src/nsMetaCharsetObserver.cpp +++ b/intl/chardet/src/nsMetaCharsetObserver.cpp @@ -43,7 +43,6 @@ nsMetaCharsetObserver::nsMetaCharsetObserver() { NS_INIT_REFCNT(); bMetaCharsetObserverStarted = PR_FALSE; - PR_AtomicIncrement(& g_InstanceCount); nsresult res; mAlias = nsnull; NS_WITH_SERVICE(nsICharsetAlias, calias, kCharsetAliasCID, &res); @@ -55,7 +54,6 @@ nsMetaCharsetObserver::nsMetaCharsetObserver() nsMetaCharsetObserver::~nsMetaCharsetObserver() { // should we release mAlias - PR_AtomicDecrement(& g_InstanceCount); if (bMetaCharsetObserverStarted == PR_TRUE) { // call to end the ObserverService End(); diff --git a/intl/chardet/src/nsPSMDetectors.cpp b/intl/chardet/src/nsPSMDetectors.cpp index c6fa3339aa4..998b237c69d 100644 --- a/intl/chardet/src/nsPSMDetectors.cpp +++ b/intl/chardet/src/nsPSMDetectors.cpp @@ -312,13 +312,11 @@ nsXPCOMDetector::nsXPCOMDetector(PRUint8 aItems, nsVerifier **aVer, nsEUCStatist : nsPSMDetector( aItems, aVer, aStatisticsSet) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); mObserver = nsnull; } //---------------------------------------------------------- nsXPCOMDetector::~nsXPCOMDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- NS_IMETHODIMP nsXPCOMDetector::Init( @@ -361,12 +359,10 @@ nsXPCOMStringDetector::nsXPCOMStringDetector(PRUint8 aItems, nsVerifier** aVer, : nsPSMDetector( aItems, aVer, aStatisticsSet) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } //---------------------------------------------------------- nsXPCOMStringDetector::~nsXPCOMStringDetector() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- void nsXPCOMStringDetector::Report(const char* charset) diff --git a/intl/chardet/src/nsXMLEncodingObserver.cpp b/intl/chardet/src/nsXMLEncodingObserver.cpp index a46537bd726..e56d40ae2b7 100644 --- a/intl/chardet/src/nsXMLEncodingObserver.cpp +++ b/intl/chardet/src/nsXMLEncodingObserver.cpp @@ -41,14 +41,11 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); nsXMLEncodingObserver::nsXMLEncodingObserver() { NS_INIT_REFCNT(); - PR_AtomicIncrement(& g_InstanceCount); bXMLEncodingObserverStarted = PR_FALSE; } //------------------------------------------------------------------------- nsXMLEncodingObserver::~nsXMLEncodingObserver() { - PR_AtomicDecrement(& g_InstanceCount); - // call to end the ObserverService if (bXMLEncodingObserverStarted == PR_TRUE) { End(); diff --git a/intl/chardet/src/windows/nsNativeCharDetDll.cpp b/intl/chardet/src/windows/nsNativeCharDetDll.cpp index e613249784b..15b881e3266 100644 --- a/intl/chardet/src/windows/nsNativeCharDetDll.cpp +++ b/intl/chardet/src/windows/nsNativeCharDetDll.cpp @@ -44,10 +44,6 @@ static NS_DEFINE_CID(kKONativeStringDetectorCID, NS_KO_NATIVE_STRING_DETECTOR_ static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); static NS_DEFINE_IID(kFactoryIID, NS_IFACTORY_IID); -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - - extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr, const nsCID &aClass, const char *aClassName, @@ -83,7 +79,7 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr, } extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr) { - return PRBool(g_InstanceCount == 0 && g_LockCount == 0); + return PR_FALSE; } extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *path) { diff --git a/intl/chardet/src/windows/nsNativeCharDetDll.h b/intl/chardet/src/windows/nsNativeCharDetDll.h index 96cd057a066..29a56069ae0 100644 --- a/intl/chardet/src/windows/nsNativeCharDetDll.h +++ b/intl/chardet/src/windows/nsNativeCharDetDll.h @@ -25,7 +25,4 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #endif /* nsNativeCharDetDll_h__ */ diff --git a/intl/chardet/src/windows/nsNativeDetectors.cpp b/intl/chardet/src/windows/nsNativeDetectors.cpp index 1029e3c7a8b..79c60ae9350 100644 --- a/intl/chardet/src/windows/nsNativeDetectors.cpp +++ b/intl/chardet/src/windows/nsNativeDetectors.cpp @@ -117,7 +117,6 @@ nsNativeDetector::nsNativeDetector(PRUint32 aCodePage) mCodePage = aCodePage; mMultiLanguage = NULL; mMLangConvertCharset = NULL; - PR_AtomicIncrement(&g_InstanceCount); } //---------------------------------------------------------- nsNativeDetector::~nsNativeDetector() @@ -128,7 +127,6 @@ nsNativeDetector::~nsNativeDetector() if (NULL != mMLangConvertCharset) mMLangConvertCharset->Release(); CoUninitialize(); - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- NS_IMETHODIMP nsNativeDetector::Init( @@ -208,7 +206,6 @@ nsNativeStringDetector::nsNativeStringDetector(PRUint32 aCodePage) NS_INIT_REFCNT(); mCodePage = aCodePage; mMultiLanguage = NULL; - PR_AtomicIncrement(&g_InstanceCount); } //---------------------------------------------------------- nsNativeStringDetector::~nsNativeStringDetector() @@ -216,7 +213,6 @@ nsNativeStringDetector::~nsNativeStringDetector() if (NULL != mMultiLanguage) mMultiLanguage->Release(); CoUninitialize(); - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------- @@ -265,10 +261,8 @@ public: NS_INIT_REFCNT(); mCodePage = aCodePage; mStringBase = stringBase; - PR_AtomicIncrement(&g_InstanceCount); } virtual ~nsNativeDetectorFactory() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHOD CreateInstance(nsISupports* aDelegate, const nsIID& aIID, void** aResult); @@ -309,10 +303,6 @@ NS_IMETHODIMP nsNativeDetectorFactory::CreateInstance( //-------------------------------------------------------------- NS_IMETHODIMP nsNativeDetectorFactory::LockFactory(PRBool aLock) { - if(aLock) - PR_AtomicIncrement( &g_LockCount ); - else - PR_AtomicDecrement( &g_LockCount ); return NS_OK; } diff --git a/intl/lwbrk/src/nsJISx4501LineBreaker.cpp b/intl/lwbrk/src/nsJISx4501LineBreaker.cpp index 8d6125a2b5d..3952aa17fdf 100644 --- a/intl/lwbrk/src/nsJISx4501LineBreaker.cpp +++ b/intl/lwbrk/src/nsJISx4501LineBreaker.cpp @@ -315,11 +315,9 @@ nsJISx4501LineBreaker::nsJISx4501LineBreaker( ) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsJISx4501LineBreaker::~nsJISx4501LineBreaker() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMPL_ISUPPORTS1(nsJISx4501LineBreaker, nsILineBreaker); diff --git a/intl/lwbrk/src/nsLWBRKDll.h b/intl/lwbrk/src/nsLWBRKDll.h index 9abe0153676..e3f516be49e 100644 --- a/intl/lwbrk/src/nsLWBRKDll.h +++ b/intl/lwbrk/src/nsLWBRKDll.h @@ -25,10 +25,4 @@ #include "prtypes.h" -#define g_InstanceCount lwbrk_g_InstanceCount -#define g_LockCount lwbrk_g_LockCount - -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #endif /* nsLWBRKDll_h___ */ diff --git a/intl/lwbrk/src/nsLWBreakerFImp.cpp b/intl/lwbrk/src/nsLWBreakerFImp.cpp index eaa9c099b26..9b12052820b 100644 --- a/intl/lwbrk/src/nsLWBreakerFImp.cpp +++ b/intl/lwbrk/src/nsLWBreakerFImp.cpp @@ -30,11 +30,9 @@ nsLWBreakerFImp::nsLWBreakerFImp() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsLWBreakerFImp::~nsLWBreakerFImp() { - PR_AtomicDecrement(&g_InstanceCount); } NS_DEFINE_IID(kILineBreakerFactoryIID, NS_ILINEBREAKERFACTORY_IID); diff --git a/intl/lwbrk/src/nsLWBrkModule.cpp b/intl/lwbrk/src/nsLWBrkModule.cpp index 108877828e3..1e8d4801f9b 100644 --- a/intl/lwbrk/src/nsLWBrkModule.cpp +++ b/intl/lwbrk/src/nsLWBrkModule.cpp @@ -27,9 +27,6 @@ #include "nsLWBreakerFImp.h" #include "nsLWBRKDll.h" -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - NS_GENERIC_FACTORY_CONSTRUCTOR(nsLWBreakerFImp) static nsModuleComponentInfo components[] = { diff --git a/intl/lwbrk/src/nsSampleWordBreaker.cpp b/intl/lwbrk/src/nsSampleWordBreaker.cpp index 98eb4366fa9..5ba69d1bd3d 100644 --- a/intl/lwbrk/src/nsSampleWordBreaker.cpp +++ b/intl/lwbrk/src/nsSampleWordBreaker.cpp @@ -28,11 +28,9 @@ nsSampleWordBreaker::nsSampleWordBreaker() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsSampleWordBreaker::~nsSampleWordBreaker() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMPL_ISUPPORTS1(nsSampleWordBreaker, nsIWordBreaker); diff --git a/intl/uconv/src/nsCharsetAliasImp.cpp b/intl/uconv/src/nsCharsetAliasImp.cpp index 0aeee2b9721..3d7f00e6ff4 100644 --- a/intl/uconv/src/nsCharsetAliasImp.cpp +++ b/intl/uconv/src/nsCharsetAliasImp.cpp @@ -63,13 +63,11 @@ NS_IMPL_ISUPPORTS1(nsCharsetAlias2, nsICharsetAlias); nsCharsetAlias2::nsCharsetAlias2() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); mDelegate = nsnull; // delay the load of mDelegate untill we need it. } //-------------------------------------------------------------- nsCharsetAlias2::~nsCharsetAlias2() { - PR_AtomicDecrement(&g_InstanceCount); if(mDelegate) delete mDelegate; } diff --git a/intl/uconv/src/nsCharsetConverterManager.cpp b/intl/uconv/src/nsCharsetConverterManager.cpp index e08c768706a..0f4e51d8891 100644 --- a/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/intl/uconv/src/nsCharsetConverterManager.cpp @@ -176,14 +176,12 @@ nsCharsetConverterManager::nsCharsetConverterManager() :mDataBundle(NULL), mTitleBundle(NULL) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsCharsetConverterManager::~nsCharsetConverterManager() { NS_IF_RELEASE(mDataBundle); NS_IF_RELEASE(mTitleBundle); - PR_AtomicDecrement(&g_InstanceCount); } nsresult nsCharsetConverterManager::RegisterConverterManagerData() diff --git a/intl/uconv/src/nsCharsetMenu.cpp b/intl/uconv/src/nsCharsetMenu.cpp index 1a55d87d95f..b8bc6ea7153 100644 --- a/intl/uconv/src/nsCharsetMenu.cpp +++ b/intl/uconv/src/nsCharsetMenu.cpp @@ -371,7 +371,6 @@ nsIRDFResource * nsCharsetMenu::kRDF_type = NULL; nsCharsetMenu::nsCharsetMenu() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); nsresult res = NS_OK; @@ -396,8 +395,6 @@ nsCharsetMenu::~nsCharsetMenu() FreeMenuItemArray(&mComposerMenu); FreeResources(); - - PR_AtomicDecrement(&g_InstanceCount); } // XXX collapse these 2 in one diff --git a/intl/uconv/src/nsMacCharset.cpp b/intl/uconv/src/nsMacCharset.cpp index 84d4ba7f609..49552e27d4d 100644 --- a/intl/uconv/src/nsMacCharset.cpp +++ b/intl/uconv/src/nsMacCharset.cpp @@ -57,7 +57,6 @@ NS_IMPL_ISUPPORTS(nsMacCharset, kIPlatformCharsetIID); nsMacCharset::nsMacCharset() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); PR_AtomicIncrement(&gCnt); // XXX we should make the following block critical section @@ -94,7 +93,6 @@ nsMacCharset::nsMacCharset() } nsMacCharset::~nsMacCharset() { - PR_AtomicDecrement(&g_InstanceCount); PR_AtomicDecrement(&gCnt); if((0 == gCnt) && (nsnull != gInfo)) { delete gInfo; diff --git a/intl/uconv/src/nsOS2Charset.cpp b/intl/uconv/src/nsOS2Charset.cpp index 965b0ff55ec..b7cbc0401ba 100644 --- a/intl/uconv/src/nsOS2Charset.cpp +++ b/intl/uconv/src/nsOS2Charset.cpp @@ -59,7 +59,6 @@ NS_IMPL_ISUPPORTS1(nsOS2Charset, nsIPlatformCharset); nsOS2Charset::nsOS2Charset() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); PR_AtomicIncrement(&gCnt); // count for gInfo // XXX We should make the following block critical section @@ -91,7 +90,6 @@ nsOS2Charset::nsOS2Charset() nsOS2Charset::~nsOS2Charset() { - PR_AtomicDecrement(&g_InstanceCount); PR_AtomicDecrement(&gCnt); if(0 == gCnt) { delete gInfo; @@ -113,10 +111,8 @@ class nsOS2CharsetFactory : public nsIFactory { public: nsOS2CharsetFactory() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } virtual ~nsOS2CharsetFactory() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHOD CreateInstance(nsISupports* aDelegate, const nsIID& aIID, void** aResult); @@ -148,10 +144,6 @@ NS_IMETHODIMP nsOS2CharsetFactory::CreateInstance( } NS_IMETHODIMP nsOS2CharsetFactory::LockFactory(PRBool aLock) { - if(aLock) - PR_AtomicIncrement( &g_LockCount ); - else - PR_AtomicDecrement( &g_LockCount ); return NS_OK; } diff --git a/intl/uconv/src/nsTextToSubURI.cpp b/intl/uconv/src/nsTextToSubURI.cpp index 80b0974f7a3..7479b1908dc 100644 --- a/intl/uconv/src/nsTextToSubURI.cpp +++ b/intl/uconv/src/nsTextToSubURI.cpp @@ -43,11 +43,9 @@ public: nsTextToSubURI::nsTextToSubURI() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsTextToSubURI::~nsTextToSubURI() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMPL_ISUPPORTS1(nsTextToSubURI, nsITextToSubURI) diff --git a/intl/uconv/src/nsUConvDll.cpp b/intl/uconv/src/nsUConvDll.cpp index 90090673347..f55ef05b71f 100644 --- a/intl/uconv/src/nsUConvDll.cpp +++ b/intl/uconv/src/nsUConvDll.cpp @@ -58,7 +58,7 @@ NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); extern "C" NS_EXPORT PRBool NSCanUnload(nsISupports* aServMgr) { - return PRBool(g_InstanceCount == 0 && g_LockCount == 0); + return PR_FALSE; } extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* aServMgr, diff --git a/intl/uconv/src/nsUConvDll.h b/intl/uconv/src/nsUConvDll.h index cb344799af8..ac65a0a0bd7 100644 --- a/intl/uconv/src/nsUConvDll.h +++ b/intl/uconv/src/nsUConvDll.h @@ -25,9 +25,6 @@ #include "nsISupports.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - // Factory methods NS_IMETHODIMP diff --git a/intl/uconv/src/nsUConvModule.cpp b/intl/uconv/src/nsUConvModule.cpp index d72cc1870a3..13a1a522c58 100644 --- a/intl/uconv/src/nsUConvModule.cpp +++ b/intl/uconv/src/nsUConvModule.cpp @@ -67,9 +67,6 @@ NS_DEFINE_CID(kUnicodeToCP1252CID, NS_UNICODETOCP1252_CID); NS_DEFINE_CID(kUnicodeToMacRomanCID, NS_UNICODETOMACROMAN_CID); NS_DEFINE_CID(kUnicodeToUTF8CID, NS_UNICODETOUTF8_CID); -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - class nsUConvModule : public nsIModule { public: nsUConvModule(); @@ -87,8 +84,6 @@ protected: PRBool mInitialized; }; -static NS_DEFINE_IID(kIModuleIID, NS_IMODULE_IID); - nsUConvModule::nsUConvModule() : mInitialized(PR_FALSE) { diff --git a/intl/uconv/src/nsUCvMinDll.h b/intl/uconv/src/nsUCvMinDll.h index 355917d2449..38f14849ed3 100644 --- a/intl/uconv/src/nsUCvMinDll.h +++ b/intl/uconv/src/nsUCvMinDll.h @@ -25,7 +25,4 @@ #include "prtypes.h" -extern PRInt32 g_InstanceCount; -extern PRInt32 g_LockCount; - #endif /* nsUCvMinDll_h___ */ diff --git a/intl/uconv/src/nsUCvMinSupport.cpp b/intl/uconv/src/nsUCvMinSupport.cpp index 6ecefe88e99..3c535252639 100644 --- a/intl/uconv/src/nsUCvMinSupport.cpp +++ b/intl/uconv/src/nsUCvMinSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/src/nsUNIXCharset.cpp b/intl/uconv/src/nsUNIXCharset.cpp index cca90bb21b2..b732a21964f 100644 --- a/intl/uconv/src/nsUNIXCharset.cpp +++ b/intl/uconv/src/nsUNIXCharset.cpp @@ -78,7 +78,6 @@ static PRInt32 gCnt=0; nsUNIXCharset::nsUNIXCharset() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); PR_AtomicIncrement(&gCnt); } @@ -124,7 +123,6 @@ nsUNIXCharset::ConvertLocaleToCharsetUsingDeprecatedConfig(nsAutoString& locale, nsUNIXCharset::~nsUNIXCharset() { - PR_AtomicDecrement(&g_InstanceCount); PR_AtomicDecrement(&gCnt); if(0 == gCnt) { if (gNLInfo) { diff --git a/intl/uconv/src/nsUnicodeDecodeHelper.cpp b/intl/uconv/src/nsUnicodeDecodeHelper.cpp index 2863af3e531..710a4ed0c1d 100644 --- a/intl/uconv/src/nsUnicodeDecodeHelper.cpp +++ b/intl/uconv/src/nsUnicodeDecodeHelper.cpp @@ -86,12 +86,10 @@ NS_IMPL_ISUPPORTS1(nsUnicodeDecodeHelper, nsIUnicodeDecodeHelper) nsUnicodeDecodeHelper::nsUnicodeDecodeHelper() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsUnicodeDecodeHelper::~nsUnicodeDecodeHelper() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/src/nsUnicodeEncodeHelper.cpp b/intl/uconv/src/nsUnicodeEncodeHelper.cpp index 9e80dc04867..2aaed500949 100644 --- a/intl/uconv/src/nsUnicodeEncodeHelper.cpp +++ b/intl/uconv/src/nsUnicodeEncodeHelper.cpp @@ -80,12 +80,10 @@ NS_IMPL_ISUPPORTS1(nsUnicodeEncodeHelper, nsIUnicodeEncodeHelper) nsUnicodeEncodeHelper::nsUnicodeEncodeHelper() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsUnicodeEncodeHelper::~nsUnicodeEncodeHelper() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/src/nsWinCharset.cpp b/intl/uconv/src/nsWinCharset.cpp index 82866b8799a..979673b91aa 100644 --- a/intl/uconv/src/nsWinCharset.cpp +++ b/intl/uconv/src/nsWinCharset.cpp @@ -56,7 +56,6 @@ NS_IMPL_ISUPPORTS1(nsWinCharset, nsIPlatformCharset) nsWinCharset::nsWinCharset() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); PR_AtomicIncrement(&gCnt); // count for gInfo // XXX We should make the following block critical section @@ -87,7 +86,6 @@ nsWinCharset::nsWinCharset() } nsWinCharset::~nsWinCharset() { - PR_AtomicDecrement(&g_InstanceCount); PR_AtomicDecrement(&gCnt); if(0 == gCnt) { delete gInfo; diff --git a/intl/uconv/ucvcn/nsUCvCnDll.h b/intl/uconv/ucvcn/nsUCvCnDll.h index 52523e58d05..aac1623d7ba 100644 --- a/intl/uconv/ucvcn/nsUCvCnDll.h +++ b/intl/uconv/ucvcn/nsUCvCnDll.h @@ -25,8 +25,5 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #define g_AsciiMapping ucvcn_g_AsciiMapping #endif /* nsUCvCnDll_h___ */ diff --git a/intl/uconv/ucvcn/nsUCvCnSupport.cpp b/intl/uconv/ucvcn/nsUCvCnSupport.cpp index 98d41b5f47e..5f3e353fae5 100644 --- a/intl/uconv/ucvcn/nsUCvCnSupport.cpp +++ b/intl/uconv/ucvcn/nsUCvCnSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvibm/nsUCvIBMDll.h b/intl/uconv/ucvibm/nsUCvIBMDll.h index a322cebeac1..690e6604065 100644 --- a/intl/uconv/ucvibm/nsUCvIBMDll.h +++ b/intl/uconv/ucvibm/nsUCvIBMDll.h @@ -38,7 +38,4 @@ #include "prtypes.h" -extern PRInt32 g_InstanceCount; -extern PRInt32 g_LockCount; - #endif /* nsUCvIBMDll_h___ */ diff --git a/intl/uconv/ucvibm/nsUCvIBMSupport.cpp b/intl/uconv/ucvibm/nsUCvIBMSupport.cpp index dfc77d069c4..f29acf0a1a7 100644 --- a/intl/uconv/ucvibm/nsUCvIBMSupport.cpp +++ b/intl/uconv/ucvibm/nsUCvIBMSupport.cpp @@ -50,12 +50,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -364,12 +362,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvja/nsUCVJADll.h b/intl/uconv/ucvja/nsUCVJADll.h index 7ccc7952f91..97af00fa7c6 100644 --- a/intl/uconv/ucvja/nsUCVJADll.h +++ b/intl/uconv/ucvja/nsUCVJADll.h @@ -25,8 +25,6 @@ #include "prtypes.h" -extern PRInt32 g_InstanceCount; -extern PRInt32 g_LockCount; extern PRUint16 g_ut0201Mapping[]; extern PRUint16 g_ut0208Mapping[]; extern PRUint16 g_ut0212Mapping[]; diff --git a/intl/uconv/ucvja/nsUCvJaSupport.cpp b/intl/uconv/ucvja/nsUCvJaSupport.cpp index 8030cea9a18..7f176953326 100644 --- a/intl/uconv/ucvja/nsUCvJaSupport.cpp +++ b/intl/uconv/ucvja/nsUCvJaSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvko/nsUCvKODll.h b/intl/uconv/ucvko/nsUCvKODll.h index a46bdd26f4b..4191e3aa661 100644 --- a/intl/uconv/ucvko/nsUCvKODll.h +++ b/intl/uconv/ucvko/nsUCvKODll.h @@ -25,10 +25,6 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - - extern "C" PRUint16 g_utKSC5601Mapping[]; extern "C" PRUint16 g_ufKSC5601Mapping[]; #define g_AsciiMapping ucvko_g_AsciiMapping diff --git a/intl/uconv/ucvko/nsUCvKOSupport.cpp b/intl/uconv/ucvko/nsUCvKOSupport.cpp index 3aab6ae8f5b..85cea6084a7 100644 --- a/intl/uconv/ucvko/nsUCvKOSupport.cpp +++ b/intl/uconv/ucvko/nsUCvKOSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp b/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp index 4020c6eec96..b8d9f157610 100644 --- a/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp +++ b/intl/uconv/ucvko/nsUnicodeToX11Johab.cpp @@ -151,12 +151,10 @@ nsUnicodeToX11Johab::nsUnicodeToX11Johab() v = 0; t = 0; NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsUnicodeToX11Johab::~nsUnicodeToX11Johab() { - PR_AtomicDecrement(&g_InstanceCount); } // 41 diff --git a/intl/uconv/ucvlatin/nsUCvLatinDll.h b/intl/uconv/ucvlatin/nsUCvLatinDll.h index b0e3bdcc615..d779375d402 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinDll.h +++ b/intl/uconv/ucvlatin/nsUCvLatinDll.h @@ -28,7 +28,4 @@ #define g_InstanceCount ucvlatin_g_InstanceCount #define g_LockCount ucvlatin_g_LockCount -extern PRInt32 g_InstanceCount; -extern PRInt32 g_LockCount; - #endif /* nsUCvLatinDll_h___ */ diff --git a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp index 995db91aa34..460a0132efa 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp +++ b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvmath/nsUCvMathDll.h b/intl/uconv/ucvmath/nsUCvMathDll.h index 9eced7fe862..e0652c3f28b 100644 --- a/intl/uconv/ucvmath/nsUCvMathDll.h +++ b/intl/uconv/ucvmath/nsUCvMathDll.h @@ -36,7 +36,4 @@ #include "prtypes.h" -extern PRInt32 g_InstanceCount; -extern PRInt32 g_LockCount; - #endif /* nsUCvMathDll_h___ */ diff --git a/intl/uconv/ucvmath/nsUCvMathSupport.cpp b/intl/uconv/ucvmath/nsUCvMathSupport.cpp index 1b62975a46a..a20ac971b88 100644 --- a/intl/uconv/ucvmath/nsUCvMathSupport.cpp +++ b/intl/uconv/ucvmath/nsUCvMathSupport.cpp @@ -47,12 +47,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -361,12 +359,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvtw/nsUCvTWDll.h b/intl/uconv/ucvtw/nsUCvTWDll.h index d31f20f9513..f64d97d6000 100644 --- a/intl/uconv/ucvtw/nsUCvTWDll.h +++ b/intl/uconv/ucvtw/nsUCvTWDll.h @@ -25,8 +25,6 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; extern "C" PRUint16 g_ufBig5Mapping[]; extern "C" PRUint16 g_utBIG5Mapping[]; extern "C" PRUint16 g_ASCIIMapping[]; diff --git a/intl/uconv/ucvtw/nsUCvTWSupport.cpp b/intl/uconv/ucvtw/nsUCvTWSupport.cpp index 3d9d3d4afe7..921eeb5b78e 100644 --- a/intl/uconv/ucvtw/nsUCvTWSupport.cpp +++ b/intl/uconv/ucvtw/nsUCvTWSupport.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/uconv/ucvtw2/nsUCvTW2Dll.h b/intl/uconv/ucvtw2/nsUCvTW2Dll.h index 27e54f594e4..cc137739505 100644 --- a/intl/uconv/ucvtw2/nsUCvTW2Dll.h +++ b/intl/uconv/ucvtw2/nsUCvTW2Dll.h @@ -25,9 +25,6 @@ #include "prtypes.h" -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - extern "C" PRUint16 g_ASCIIMappingTable[] ; extern "C" PRUint16 g_ufCNS1MappingTable[]; extern "C" PRUint16 g_ufCNS2MappingTable[]; diff --git a/intl/uconv/ucvtw2/nsUCvTW2Support.cpp b/intl/uconv/ucvtw2/nsUCvTW2Support.cpp index f6c606208ce..22436edb4a0 100644 --- a/intl/uconv/ucvtw2/nsUCvTW2Support.cpp +++ b/intl/uconv/ucvtw2/nsUCvTW2Support.cpp @@ -37,12 +37,10 @@ nsBasicDecoderSupport::nsBasicDecoderSupport() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicDecoderSupport::~nsBasicDecoderSupport() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- @@ -351,12 +349,10 @@ NS_IMETHODIMP nsOneByteDecoderSupport::Reset() nsBasicEncoder::nsBasicEncoder() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBasicEncoder::~nsBasicEncoder() { - PR_AtomicDecrement(&g_InstanceCount); } //---------------------------------------------------------------------- diff --git a/intl/unicharutil/src/nsBidiImp.cpp b/intl/unicharutil/src/nsBidiImp.cpp index 70a6f762514..94fea815631 100644 --- a/intl/unicharutil/src/nsBidiImp.cpp +++ b/intl/unicharutil/src/nsBidiImp.cpp @@ -198,13 +198,11 @@ nsBidi::nsBidi(PRUint32 aMaxLength, PRUint32 aMaxRunCount) nsBidi::~nsBidi() { Free(); - PR_AtomicDecrement(&g_InstanceCount); } void nsBidi::Init() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); /* reset the object, all pointers NULL, all flags PR_FALSE, all sizes 0 */ mLength = 0; mParaLevel = 0; diff --git a/intl/unicharutil/src/nsBidiUtilsImp.cpp b/intl/unicharutil/src/nsBidiUtilsImp.cpp index c413158fa1c..2c3d51f7d89 100644 --- a/intl/unicharutil/src/nsBidiUtilsImp.cpp +++ b/intl/unicharutil/src/nsBidiUtilsImp.cpp @@ -213,12 +213,10 @@ static PRUint16 gArabicLigatureMap[] = nsBidiUtilsImp::nsBidiUtilsImp() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsBidiUtilsImp::~nsBidiUtilsImp() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHODIMP nsBidiUtilsImp::GetBidiCategory(PRUnichar aChar, eBidiCategory* oResult) diff --git a/intl/unicharutil/src/nsCaseConversionImp2.cpp b/intl/unicharutil/src/nsCaseConversionImp2.cpp index 6dc0a0eb86c..78b4a31b841 100644 --- a/intl/unicharutil/src/nsCaseConversionImp2.cpp +++ b/intl/unicharutil/src/nsCaseConversionImp2.cpp @@ -430,12 +430,10 @@ nsCaseConversionImp2::nsCaseConversionImp2() gLowerMap = new nsCompressedMap(NS_REINTERPRET_CAST(PRUnichar*, &gToLower[0]), gToLowerItems); } NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsCaseConversionImp2::~nsCaseConversionImp2() { - PR_AtomicDecrement(&g_InstanceCount); if (--gInit == 0) { delete gUpperMap; gUpperMap = nsnull; diff --git a/intl/unicharutil/src/nsCategoryImp.cpp b/intl/unicharutil/src/nsCategoryImp.cpp index 462beed616d..e4af8431628 100644 --- a/intl/unicharutil/src/nsCategoryImp.cpp +++ b/intl/unicharutil/src/nsCategoryImp.cpp @@ -33,12 +33,10 @@ NS_IMPL_ISUPPORTS1(nsCategoryImp, nsIUGenCategory); nsCategoryImp::nsCategoryImp() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsCategoryImp::~nsCategoryImp() { - PR_AtomicDecrement(&g_InstanceCount); } nsresult nsCategoryImp::Get( PRUnichar aChar, nsUGenCategory* oResult) diff --git a/intl/unicharutil/src/nsCharsOrderIdFormater.cpp b/intl/unicharutil/src/nsCharsOrderIdFormater.cpp index 586a4f55fdd..86b2bf5e2f8 100644 --- a/intl/unicharutil/src/nsCharsOrderIdFormater.cpp +++ b/intl/unicharutil/src/nsCharsOrderIdFormater.cpp @@ -28,7 +28,6 @@ nsCharsOrderIdFormater::nsCharsOrderIdFormater( nsCharsList* aList) { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); mList = aList; mBase = aList->Length(); } @@ -36,7 +35,6 @@ nsCharsOrderIdFormater::nsCharsOrderIdFormater( nsCharsList* aList) nsCharsOrderIdFormater::~nsCharsOrderIdFormater() { delete mList; - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHOD ToString( PRUint32 aOrder, nsString& aResult) @@ -64,20 +62,14 @@ class nsCharsOrderIdFormaterFactory : public nsIFactory { public: nsCharsOrderIdFormaterFactory(const nsCID &aCID) { NS_INIT_REFCNT(); - PR_AutomicIncrement(&g_InstanceCount); mCID = aCID; }; virtual ~nsCharsOrderIdFormaterFactory() { - PR_AutomicDecrement(&g_InstanceCount); }; NS_IMETHOD CreateInstance(nsISupports *aDelegate, const nsIID &aIID, void **aResult); NS_IMETHOD LockFactory(PRBool aLock) { - if(aLock) - PR_AutomicIncrement(&g_LockCount); - else - PR_AutomicDecrement(&g_LockCount); return NS_OK; }; diff --git a/intl/unicharutil/src/nsHankakuToZenkaku.cpp b/intl/unicharutil/src/nsHankakuToZenkaku.cpp index 662d71b29ef..6a7c13c1707 100644 --- a/intl/unicharutil/src/nsHankakuToZenkaku.cpp +++ b/intl/unicharutil/src/nsHankakuToZenkaku.cpp @@ -129,11 +129,9 @@ NS_IMPL_ISUPPORTS1(nsHankakuToZenkaku, nsITextTransform) nsHankakuToZenkaku::nsHankakuToZenkaku() { NS_INIT_REFCNT(); - PR_AtomicIncrement(&g_InstanceCount); } nsHankakuToZenkaku::~nsHankakuToZenkaku() { - PR_AtomicDecrement(&g_InstanceCount); } NS_IMETHODIMP nsHankakuToZenkaku::Change( nsString& aText, nsString& aResult) diff --git a/intl/unicharutil/src/nsUUDll.h b/intl/unicharutil/src/nsUUDll.h index 3be3feca088..bfb304937d1 100644 --- a/intl/unicharutil/src/nsUUDll.h +++ b/intl/unicharutil/src/nsUUDll.h @@ -25,10 +25,4 @@ #include "prtypes.h" -#define g_InstanceCount nsUcharUtilModule_g_InstanceCount -#define g_LockCount nsUcharUtilModule_g_LockCount - -extern "C" PRInt32 g_InstanceCount; -extern "C" PRInt32 g_LockCount; - #endif /* nsUUDll_h__ */ diff --git a/intl/unicharutil/src/nsUcharUtilModule.cpp b/intl/unicharutil/src/nsUcharUtilModule.cpp index a036b44ac9f..1297398174b 100644 --- a/intl/unicharutil/src/nsUcharUtilModule.cpp +++ b/intl/unicharutil/src/nsUcharUtilModule.cpp @@ -80,9 +80,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidi) // Since our class still refer to this two per dll global leave it here untill // we change their code -PRInt32 g_InstanceCount = 0; -PRInt32 g_LockCount = 0; - static nsModuleComponentInfo components[] = { { "Unichar Utility", NS_UNICHARUTIL_CID,