diff --git a/mozilla/config/config.mak b/mozilla/config/config.mak index 8572757e53b..62ab33571fb 100644 --- a/mozilla/config/config.mak +++ b/mozilla/config/config.mak @@ -380,6 +380,8 @@ CFLAGS=$(CFLAGS) -DUSE_IMG2 -DNS_PRINT_PREVIEW CFLAGS=$(CFLAGS) -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT -DMOZ_STATIC_COMPONENT_LIBS !endif +CFLAGS=$(CFLAGS) -DCPP_THROW_NEW=throw() + #//----------------------------------------------------------------------- #// #// build tools diff --git a/mozilla/config/mac/DefinesMac.h b/mozilla/config/mac/DefinesMac.h index f9b413509cb..a54e75ec423 100644 --- a/mozilla/config/mac/DefinesMac.h +++ b/mozilla/config/mac/DefinesMac.h @@ -80,5 +80,6 @@ #define _NO_FAST_STRING_INLINES_ 1 #define _PR_NO_PREEMPT 1 ///#define HAVE_BOOLEAN 1 // used by JPEG lib +#define CPP_THROW_NEW #endif /* DefinesMac_h_ */ diff --git a/mozilla/content/base/public/nsIStyleRuleProcessor.h b/mozilla/content/base/public/nsIStyleRuleProcessor.h index 3c51832ceb2..c3e7cb4c1f4 100644 --- a/mozilla/content/base/public/nsIStyleRuleProcessor.h +++ b/mozilla/content/base/public/nsIStyleRuleProcessor.h @@ -68,7 +68,7 @@ struct RuleProcessorData { // NOTE: not |virtual| ~RuleProcessorData(); - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/content/base/src/nsRuleNode.cpp b/mozilla/content/base/src/nsRuleNode.cpp index 249b8dd0c23..acbea6cee98 100644 --- a/mozilla/content/base/src/nsRuleNode.cpp +++ b/mozilla/content/base/src/nsRuleNode.cpp @@ -74,7 +74,7 @@ public: mNext->Destroy(mNext->mRuleNode->mPresContext); } - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -374,7 +374,7 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) +nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index 33794fe4f52..4eea9ad0fff 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -1249,7 +1249,7 @@ void nsStyleContext::DumpRegressionData(nsIPresContext* aPresContext, FILE* out, // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) +nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/content/base/src/nsStyleSet.cpp b/mozilla/content/base/src/nsStyleSet.cpp index 48245cf8e28..5e8e0c68886 100644 --- a/mozilla/content/base/src/nsStyleSet.cpp +++ b/mozilla/content/base/src/nsStyleSet.cpp @@ -84,7 +84,7 @@ struct nsRuleNodeList :mRuleNode(aRuleNode), mNext(aNext) {}; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/content/events/src/nsDOMEvent.cpp b/mozilla/content/events/src/nsDOMEvent.cpp index e5d0a57d034..8b8602c7335 100644 --- a/mozilla/content/events/src/nsDOMEvent.cpp +++ b/mozilla/content/events/src/nsDOMEvent.cpp @@ -93,7 +93,7 @@ static PRInt32 numAllocFromPool=0; // allocate the memory for the object from the recycler, if possible // otherwise, just grab it from the heap. void* -nsDOMEvent::operator new(size_t aSize) +nsDOMEvent::operator new(size_t aSize) CPP_THROW_NEW { #ifdef NS_DEBUG diff --git a/mozilla/content/html/style/src/nsCSSRule.cpp b/mozilla/content/html/style/src/nsCSSRule.cpp index c5e8fa7106f..9b33772c2e7 100644 --- a/mozilla/content/html/style/src/nsCSSRule.cpp +++ b/mozilla/content/html/style/src/nsCSSRule.cpp @@ -40,7 +40,7 @@ #include "nsIArena.h" #include "nsICSSStyleSheet.h" -void* nsCSSRule::operator new(size_t size) +void* nsCSSRule::operator new(size_t size) CPP_THROW_NEW { nsCSSRule* rv = (nsCSSRule*) ::operator new(size); #ifdef NS_DEBUG @@ -52,7 +52,7 @@ void* nsCSSRule::operator new(size_t size) return (void*) rv; } -void* nsCSSRule::operator new(size_t size, nsIArena* aArena) +void* nsCSSRule::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { nsCSSRule* rv = (nsCSSRule*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index 1ffc740d67e..c530259e6b2 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -201,7 +201,7 @@ struct RuleValue { } // Placement new to arena allocate the RuleValues - void *operator new(size_t aSize, PLArenaPool &aArena) { + void *operator new(size_t aSize, PLArenaPool &aArena) CPP_THROW_NEW { void *mem; PL_ARENA_ALLOCATE(mem, &aArena, aSize); return mem; @@ -1722,7 +1722,7 @@ void CSSStyleSheetInner::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz // CSS Style Sheet // -void* CSSStyleSheetImpl::operator new(size_t size) +void* CSSStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -1734,7 +1734,7 @@ void* CSSStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp index 79f4fd1d5c3..99131ec6756 100644 --- a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp @@ -286,7 +286,7 @@ protected: }; -void* HTMLCSSStyleSheetImpl::operator new(size_t size) +void* HTMLCSSStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -298,7 +298,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index 68b139e0a32..095443e8e2c 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -898,7 +898,7 @@ protected: }; -void* HTMLStyleSheetImpl::operator new(size_t size) +void* HTMLStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -910,7 +910,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/content/shared/public/nsRuleNode.h b/mozilla/content/shared/public/nsRuleNode.h index d0233b7b336..de717bb8617 100644 --- a/mozilla/content/shared/public/nsRuleNode.h +++ b/mozilla/content/shared/public/nsRuleNode.h @@ -68,7 +68,7 @@ struct nsInheritedStyleData nsStyleSVG* mSVGData; #endif - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -142,7 +142,7 @@ struct nsResetStyleData #endif }; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/content/shared/public/nsStyleStruct.h b/mozilla/content/shared/public/nsStyleStruct.h index 2e281c4d0d7..39c530afc3d 100644 --- a/mozilla/content/shared/public/nsStyleStruct.h +++ b/mozilla/content/shared/public/nsStyleStruct.h @@ -162,7 +162,7 @@ struct nsStyleColor : public nsStyleStruct { PRInt32 CalcDifference(const nsStyleColor& aOther) const; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -184,7 +184,7 @@ struct nsStyleBackground : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Background) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -504,7 +504,7 @@ struct nsStyleOutline: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Outline) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -588,7 +588,7 @@ struct nsStyleList : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_List) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -613,7 +613,7 @@ struct nsStylePosition : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Position) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -643,7 +643,7 @@ struct nsStyleTextReset : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TextReset) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -670,7 +670,7 @@ struct nsStyleText : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Text) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -703,7 +703,7 @@ struct nsStyleVisibility : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Visibility) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -737,7 +737,7 @@ struct nsStyleDisplay : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Display) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -791,7 +791,7 @@ struct nsStyleTable: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Table) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -817,7 +817,7 @@ struct nsStyleTableBorder: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TableBorder) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -868,7 +868,7 @@ struct nsStyleQuotes : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Quotes) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -929,7 +929,7 @@ struct nsStyleContent: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Content) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1068,7 +1068,7 @@ struct nsStyleUIReset: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UIReset) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1093,7 +1093,7 @@ struct nsStyleUserInterface: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UserInterface) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1121,7 +1121,7 @@ struct nsStyleXUL : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_XUL) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1160,7 +1160,7 @@ struct nsStyleSVG : public nsStyleStruct { nsStyleSVG(const nsStyleSVG& aSource); ~nsStyleSVG(); - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index 53c01b71e2f..22381d99ced 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -234,7 +234,7 @@ nsStyleFont::nsStyleFont(const nsStyleFont& aSrc) } void* -nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -315,7 +315,7 @@ nsStyleMargin::nsStyleMargin(const nsStyleMargin& aSrc) { } void* -nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -374,7 +374,7 @@ nsStylePadding::nsStylePadding(const nsStylePadding& aSrc) { } void* -nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) { +nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -474,7 +474,7 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc) } void* -nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) diff --git a/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp b/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp index 401da5f83d6..5e7cf0fd45b 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -144,7 +144,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; @@ -217,7 +217,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; diff --git a/mozilla/content/xbl/src/nsXBLService.cpp b/mozilla/content/xbl/src/nsXBLService.cpp index 8e2b8a1beec..e8e876e8ab2 100644 --- a/mozilla/content/xbl/src/nsXBLService.cpp +++ b/mozilla/content/xbl/src/nsXBLService.cpp @@ -210,7 +210,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; diff --git a/mozilla/content/xul/content/src/nsXULAttributes.h b/mozilla/content/xul/content/src/nsXULAttributes.h index 539dcf6f36d..d36c31ebcc3 100644 --- a/mozilla/content/xul/content/src/nsXULAttributes.h +++ b/mozilla/content/xul/content/src/nsXULAttributes.h @@ -203,7 +203,7 @@ protected: nsAutoVoidArray mAttributes; private: // Hide so that all construction and destruction use Create and Destroy. - static void *operator new(size_t) { return 0; }; + static void *operator new(size_t) CPP_THROW_NEW { return 0; }; static void operator delete(void *, size_t) { }; }; diff --git a/mozilla/content/xul/document/src/nsElementMap.h b/mozilla/content/xul/document/src/nsElementMap.h index 48a5b424510..c9d36a28ef5 100644 --- a/mozilla/content/xul/document/src/nsElementMap.h +++ b/mozilla/content/xul/document/src/nsElementMap.h @@ -79,7 +79,7 @@ protected: aPool.Free(aItem, sizeof(*aItem)); } protected: - static void* operator new(size_t aSize, void* aPtr) { + static void* operator new(size_t aSize, void* aPtr) CPP_THROW_NEW { return aPtr; } static void operator delete(void* aPtr, size_t aSize) { diff --git a/mozilla/content/xul/templates/src/nsClusterKeySet.h b/mozilla/content/xul/templates/src/nsClusterKeySet.h index 4cc26730e5c..dedb5fce68b 100644 --- a/mozilla/content/xul/templates/src/nsClusterKeySet.h +++ b/mozilla/content/xul/templates/src/nsClusterKeySet.h @@ -56,7 +56,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsConflictSet.h b/mozilla/content/xul/templates/src/nsConflictSet.h index ed43dbd2782..78b7f4c4c5b 100644 --- a/mozilla/content/xul/templates/src/nsConflictSet.h +++ b/mozilla/content/xul/templates/src/nsConflictSet.h @@ -231,7 +231,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: @@ -288,7 +288,7 @@ protected: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} protected: @@ -353,7 +353,7 @@ protected: protected: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsContentTestNode.h b/mozilla/content/xul/templates/src/nsContentTestNode.h index 58b62c09768..ca567a843cd 100644 --- a/mozilla/content/xul/templates/src/nsContentTestNode.h +++ b/mozilla/content/xul/templates/src/nsContentTestNode.h @@ -70,7 +70,7 @@ public: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsRDFConInstanceTestNode.h b/mozilla/content/xul/templates/src/nsRDFConInstanceTestNode.h index 51322e7fa17..40175cccfaa 100644 --- a/mozilla/content/xul/templates/src/nsRDFConInstanceTestNode.h +++ b/mozilla/content/xul/templates/src/nsRDFConInstanceTestNode.h @@ -87,7 +87,7 @@ public: protected: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsRDFConMemberTestNode.h b/mozilla/content/xul/templates/src/nsRDFConMemberTestNode.h index 5345fd3ae45..3606b491c84 100644 --- a/mozilla/content/xul/templates/src/nsRDFConMemberTestNode.h +++ b/mozilla/content/xul/templates/src/nsRDFConMemberTestNode.h @@ -83,7 +83,7 @@ public: protected: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsRDFPropertyTestNode.h b/mozilla/content/xul/templates/src/nsRDFPropertyTestNode.h index 6322823a05c..c027a509281 100644 --- a/mozilla/content/xul/templates/src/nsRDFPropertyTestNode.h +++ b/mozilla/content/xul/templates/src/nsRDFPropertyTestNode.h @@ -102,7 +102,7 @@ public: protected: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} public: diff --git a/mozilla/content/xul/templates/src/nsTemplateMatch.h b/mozilla/content/xul/templates/src/nsTemplateMatch.h index d6a63f6152f..b2d0a9c7234 100644 --- a/mozilla/content/xul/templates/src/nsTemplateMatch.h +++ b/mozilla/content/xul/templates/src/nsTemplateMatch.h @@ -62,7 +62,7 @@ class nsTemplateMatch { private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - void* operator new(size_t) { return 0; } + void* operator new(size_t) CPP_THROW_NEW { return 0; } void operator delete(void*, size_t) {} protected: diff --git a/mozilla/content/xul/templates/src/nsTreeRowTestNode.h b/mozilla/content/xul/templates/src/nsTreeRowTestNode.h index c673773c5ad..7285b70eedb 100644 --- a/mozilla/content/xul/templates/src/nsTreeRowTestNode.h +++ b/mozilla/content/xul/templates/src/nsTreeRowTestNode.h @@ -67,7 +67,7 @@ public: protected: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) { } public: diff --git a/mozilla/db/mork/src/morkDeque.h b/mozilla/db/mork/src/morkDeque.h index 6da17739009..4375ecf029a 100644 --- a/mozilla/db/mork/src/morkDeque.h +++ b/mozilla/db/mork/src/morkDeque.h @@ -55,7 +55,7 @@ public: // link memory management methods void ZapOldNext(morkEnv* ev, nsIMdbHeap* ioHeap); public: // link memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNext::MakeNewNext(inSize, ioHeap, ev); } void operator delete(void* ioAddress) // DO NOT CALL THIS, hope to crash: @@ -151,7 +151,7 @@ public: // link memory management methods void ZapOldLink(morkEnv* ev, nsIMdbHeap* ioHeap); public: // link memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkLink::MakeNewLink(inSize, ioHeap, ev); } }; diff --git a/mozilla/db/mork/src/morkFactory.h b/mozilla/db/mork/src/morkFactory.h index 6b630b9dd64..833de2a6404 100644 --- a/mozilla/db/mork/src/morkFactory.h +++ b/mozilla/db/mork/src/morkFactory.h @@ -204,10 +204,10 @@ public: // morkYarn construction & destruction public: // morkNode memory management operators - void* operator new(size_t inSize) + void* operator new(size_t inSize) CPP_THROW_NEW { return ::operator new(inSize); } - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNode::MakeNew(inSize, ioHeap, ev); } private: // copying is not allowed diff --git a/mozilla/db/mork/src/morkHandle.h b/mozilla/db/mork/src/morkHandle.h index a06e4d65187..63eb0450e26 100644 --- a/mozilla/db/mork/src/morkHandle.h +++ b/mozilla/db/mork/src/morkHandle.h @@ -116,13 +116,13 @@ public: // dynamic type identification // } ===== end morkNode methods ===== public: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/morkNode.h b/mozilla/db/mork/src/morkNode.h index b2b39745796..59c66b3e77a 100644 --- a/mozilla/db/mork/src/morkNode.h +++ b/mozilla/db/mork/src/morkNode.h @@ -157,7 +157,7 @@ public: // morkNode memory management methods // ioHeap->Free(ev->AsMdbEnv(), this); public: // morkNode memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNode::MakeNew(inSize, ioHeap, ev); } diff --git a/mozilla/db/mork/src/morkPool.h b/mozilla/db/mork/src/morkPool.h index 0625c1af43f..884b2978041 100644 --- a/mozilla/db/mork/src/morkPool.h +++ b/mozilla/db/mork/src/morkPool.h @@ -118,10 +118,10 @@ public: // typing void NonPoolTypeError(morkEnv* ev); public: // morkNode memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNode::MakeNew(inSize, ioHeap, ev); } - void* operator new(size_t inSize) + void* operator new(size_t inSize) CPP_THROW_NEW { return ::operator new(inSize); } diff --git a/mozilla/db/mork/src/morkSorting.h b/mozilla/db/mork/src/morkSorting.h index 0b0d36266fe..596bfe0a666 100644 --- a/mozilla/db/mork/src/morkSorting.h +++ b/mozilla/db/mork/src/morkSorting.h @@ -115,7 +115,7 @@ public: // sorting dirty handling more than morkNode::SetNodeDirty() etc. mork_bool IsSortingDirty() const { return this->IsNodeDirty(); } public: // morkNode memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNode::MakeNew(inSize, ioHeap, ev); } diff --git a/mozilla/db/mork/src/morkTable.h b/mozilla/db/mork/src/morkTable.h index 3c684c07459..025e94bfa0c 100644 --- a/mozilla/db/mork/src/morkTable.h +++ b/mozilla/db/mork/src/morkTable.h @@ -490,7 +490,7 @@ public: // table dirty handling more complex than morkNode::SetNodeDirty() etc. mork_bool IsTableDirty() const { return this->IsNodeDirty(); } public: // morkNode memory management operators - void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) + void* operator new(size_t inSize, nsIMdbHeap& ioHeap, morkEnv* ev) CPP_THROW_NEW { return morkNode::MakeNew(inSize, ioHeap, ev); } diff --git a/mozilla/db/mork/src/orkinCell.h b/mozilla/db/mork/src/orkinCell.h index ac1d07a2a18..fc2627d7850 100644 --- a/mozilla/db/mork/src/orkinCell.h +++ b/mozilla/db/mork/src/orkinCell.h @@ -87,13 +87,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinEnv.h b/mozilla/db/mork/src/orkinEnv.h index a4076082488..352c199c254 100644 --- a/mozilla/db/mork/src/orkinEnv.h +++ b/mozilla/db/mork/src/orkinEnv.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinFactory.h b/mozilla/db/mork/src/orkinFactory.h index 9e1b3540409..210d85e8d7d 100644 --- a/mozilla/db/mork/src/orkinFactory.h +++ b/mozilla/db/mork/src/orkinFactory.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinFile.h b/mozilla/db/mork/src/orkinFile.h index 04f251975b5..be4a2e3c484 100644 --- a/mozilla/db/mork/src/orkinFile.h +++ b/mozilla/db/mork/src/orkinFile.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinPortTableCursor.h b/mozilla/db/mork/src/orkinPortTableCursor.h index b6242d1f50a..a0fa18381d5 100644 --- a/mozilla/db/mork/src/orkinPortTableCursor.h +++ b/mozilla/db/mork/src/orkinPortTableCursor.h @@ -96,13 +96,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinRow.h b/mozilla/db/mork/src/orkinRow.h index 61e55e59b0a..d9082748c91 100644 --- a/mozilla/db/mork/src/orkinRow.h +++ b/mozilla/db/mork/src/orkinRow.h @@ -90,13 +90,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinRowCellCursor.h b/mozilla/db/mork/src/orkinRowCellCursor.h index 1d17b18604f..0511a9ff01a 100644 --- a/mozilla/db/mork/src/orkinRowCellCursor.h +++ b/mozilla/db/mork/src/orkinRowCellCursor.h @@ -97,13 +97,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } public: // construction: diff --git a/mozilla/db/mork/src/orkinSorting.h b/mozilla/db/mork/src/orkinSorting.h index cb97cda7ad3..4363e3716ad 100644 --- a/mozilla/db/mork/src/orkinSorting.h +++ b/mozilla/db/mork/src/orkinSorting.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinStore.h b/mozilla/db/mork/src/orkinStore.h index 6e2a79168a7..a0b53aeb98d 100644 --- a/mozilla/db/mork/src/orkinStore.h +++ b/mozilla/db/mork/src/orkinStore.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinTable.h b/mozilla/db/mork/src/orkinTable.h index 2767ccdefac..5197271dd01 100644 --- a/mozilla/db/mork/src/orkinTable.h +++ b/mozilla/db/mork/src/orkinTable.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinTableRowCursor.h b/mozilla/db/mork/src/orkinTableRowCursor.h index 7e3cf6ae9d9..02e2a1dbb2b 100644 --- a/mozilla/db/mork/src/orkinTableRowCursor.h +++ b/mozilla/db/mork/src/orkinTableRowCursor.h @@ -91,13 +91,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/db/mork/src/orkinThumb.h b/mozilla/db/mork/src/orkinThumb.h index 76acc0bc776..2e97deb2151 100644 --- a/mozilla/db/mork/src/orkinThumb.h +++ b/mozilla/db/mork/src/orkinThumb.h @@ -89,13 +89,13 @@ private: // copying is not allowed // } ===== end morkNode methods ===== protected: // morkHandle memory management operators - void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkZone& ioZone, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, &ioZone); } - void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) + void* operator new(size_t inSize, morkPool& ioPool, morkEnv* ev) CPP_THROW_NEW { return ioPool.NewHandle(ev, inSize, (morkZone*) 0); } - void* operator new(size_t inSize, morkHandleFace* ioFace) + void* operator new(size_t inSize, morkHandleFace* ioFace) CPP_THROW_NEW { MORK_USED_1(inSize); return ioFace; } diff --git a/mozilla/gfx/src/nsRegion.cpp b/mozilla/gfx/src/nsRegion.cpp index e0f88e9dae2..c7fb1c124ee 100644 --- a/mozilla/gfx/src/nsRegion.cpp +++ b/mozilla/gfx/src/nsRegion.cpp @@ -142,7 +142,7 @@ void RgnRectMemoryAllocator::Free (nsRegion::RgnRect* aRect) static RgnRectMemoryAllocator gRectPool (INIT_MEM_CHUNK_ENTRIES); -inline void* nsRegion::RgnRect::operator new (size_t) +inline void* nsRegion::RgnRect::operator new (size_t) CPP_THROW_NEW { return gRectPool.Alloc (); } diff --git a/mozilla/htmlparser/public/nsToken.h b/mozilla/htmlparser/public/nsToken.h index ef76dce0c4e..32d16413653 100644 --- a/mozilla/htmlparser/public/nsToken.h +++ b/mozilla/htmlparser/public/nsToken.h @@ -122,7 +122,7 @@ class CToken { * @param aSize - * @param aArena - Allocate memory from this pool. */ - static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena) + static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena) CPP_THROW_NEW { return anArena.Alloc(aSize); } diff --git a/mozilla/htmlparser/src/nsParserNode.h b/mozilla/htmlparser/src/nsParserNode.h index 3afdad7745b..98705d2dbf6 100644 --- a/mozilla/htmlparser/src/nsParserNode.h +++ b/mozilla/htmlparser/src/nsParserNode.h @@ -90,7 +90,7 @@ class nsCParserNode : public nsIParserNode { /** * Hide operator new; clients should use Create() instead. */ - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } /** * Hide operator delete; clients should use Destroy() instead. diff --git a/mozilla/js/src/xpconnect/src/xpcprivate.h b/mozilla/js/src/xpconnect/src/xpcprivate.h index 8512c86f320..ec73dcb7587 100644 --- a/mozilla/js/src/xpconnect/src/xpcprivate.h +++ b/mozilla/js/src/xpconnect/src/xpcprivate.h @@ -304,11 +304,7 @@ private: // Not meant to be implemented. This makes it a compiler error to // attempt to create an XPCAutoLock object on the heap. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - static void* operator new(size_t /*size*/) throw () { -#else - static void* operator new(size_t /*size*/) { -#endif + static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nsnull; } static void operator delete(void* /*memory*/) {} @@ -361,11 +357,7 @@ private: // Not meant to be implemented. This makes it a compiler error to // attempt to create an XPCAutoUnlock object on the heap. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - static void* operator new(size_t /*size*/) throw () { -#else - static void* operator new(size_t /*size*/) { -#endif + static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nsnull; } static void operator delete(void* /*memory*/) {} @@ -1177,7 +1169,7 @@ protected: {MOZ_COUNT_CTOR(XPCNativeInterface);} ~XPCNativeInterface() {MOZ_COUNT_DTOR(XPCNativeInterface);} - void* operator new(size_t, void* p) {return p;} + void* operator new(size_t, void* p) CPP_THROW_NEW {return p;} XPCNativeInterface(const XPCNativeInterface& r); // not implemented XPCNativeInterface& operator= (const XPCNativeInterface& r); // not implemented @@ -1316,7 +1308,7 @@ protected: PRUint16 position); XPCNativeSet() {MOZ_COUNT_CTOR(XPCNativeSet);} ~XPCNativeSet() {MOZ_COUNT_DTOR(XPCNativeSet);} - void* operator new(size_t, void* p) {return p;} + void* operator new(size_t, void* p) CPP_THROW_NEW {return p;} private: PRUint16 mMemberCount; diff --git a/mozilla/layout/base/src/nsSpaceManager.cpp b/mozilla/layout/base/src/nsSpaceManager.cpp index 72197dde44b..061ef410767 100644 --- a/mozilla/layout/base/src/nsSpaceManager.cpp +++ b/mozilla/layout/base/src/nsSpaceManager.cpp @@ -131,7 +131,7 @@ nsSpaceManager::~nsSpaceManager() } // static -void* nsSpaceManager::operator new(size_t aSize) +void* nsSpaceManager::operator new(size_t aSize) CPP_THROW_NEW { if (sCachedSpaceManagerCount > 0) { // We have cached unused instances of this class, return a cached diff --git a/mozilla/layout/generic/nsBidiFrames.cpp b/mozilla/layout/generic/nsBidiFrames.cpp index 9533a9a1332..d345b06b503 100644 --- a/mozilla/layout/generic/nsBidiFrames.cpp +++ b/mozilla/layout/generic/nsBidiFrames.cpp @@ -81,7 +81,7 @@ nsDirectionalFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) } void* -nsDirectionalFrame::operator new(size_t aSize) +nsDirectionalFrame::operator new(size_t aSize) CPP_THROW_NEW { void* frame = ::operator new(aSize); if (frame) { diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 1e334fa3668..2f1e6b6c365 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -265,7 +265,7 @@ MOZ_DECL_CTOR_COUNTER(nsFrame) // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) +nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 17f6680bcb6..c5a10feec0a 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -147,11 +147,7 @@ public: private: // The normal operator new is disallowed on nsFrames. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - void* operator new(size_t sz) throw () { return nsnull; }; -#else - void* operator new(size_t sz) { return nsnull; }; -#endif + void* operator new(size_t sz) CPP_THROW_NEW { return nsnull; }; public: diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index 75c42273669..8f861af8aa8 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -94,7 +94,7 @@ NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, // Overloaded new operator. Uses an arena (which comes from the presShell) // to perform the allocation. void* -nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) +nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { void* result = nsnull; aPresShell->AllocateFrame(sz, &result); diff --git a/mozilla/layout/generic/nsSpaceManager.cpp b/mozilla/layout/generic/nsSpaceManager.cpp index 72197dde44b..061ef410767 100644 --- a/mozilla/layout/generic/nsSpaceManager.cpp +++ b/mozilla/layout/generic/nsSpaceManager.cpp @@ -131,7 +131,7 @@ nsSpaceManager::~nsSpaceManager() } // static -void* nsSpaceManager::operator new(size_t aSize) +void* nsSpaceManager::operator new(size_t aSize) CPP_THROW_NEW { if (sCachedSpaceManagerCount > 0) { // We have cached unused instances of this class, return a cached diff --git a/mozilla/layout/html/base/src/nsBidiFrames.cpp b/mozilla/layout/html/base/src/nsBidiFrames.cpp index 9533a9a1332..d345b06b503 100644 --- a/mozilla/layout/html/base/src/nsBidiFrames.cpp +++ b/mozilla/layout/html/base/src/nsBidiFrames.cpp @@ -81,7 +81,7 @@ nsDirectionalFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) } void* -nsDirectionalFrame::operator new(size_t aSize) +nsDirectionalFrame::operator new(size_t aSize) CPP_THROW_NEW { void* frame = ::operator new(aSize); if (frame) { diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 1e334fa3668..2f1e6b6c365 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -265,7 +265,7 @@ MOZ_DECL_CTOR_COUNTER(nsFrame) // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) +nsFrame::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 17f6680bcb6..c5a10feec0a 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -147,11 +147,7 @@ public: private: // The normal operator new is disallowed on nsFrames. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - void* operator new(size_t sz) throw () { return nsnull; }; -#else - void* operator new(size_t sz) { return nsnull; }; -#endif + void* operator new(size_t sz) CPP_THROW_NEW { return nsnull; }; public: diff --git a/mozilla/layout/html/base/src/nsLineBox.cpp b/mozilla/layout/html/base/src/nsLineBox.cpp index 75c42273669..8f861af8aa8 100644 --- a/mozilla/layout/html/base/src/nsLineBox.cpp +++ b/mozilla/layout/html/base/src/nsLineBox.cpp @@ -94,7 +94,7 @@ NS_NewLineBox(nsIPresShell* aPresShell, nsIFrame* aFrame, // Overloaded new operator. Uses an arena (which comes from the presShell) // to perform the allocation. void* -nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) +nsLineBox::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { void* result = nsnull; aPresShell->AllocateFrame(sz, &result); diff --git a/mozilla/layout/style/nsCSSRule.cpp b/mozilla/layout/style/nsCSSRule.cpp index c5e8fa7106f..9b33772c2e7 100644 --- a/mozilla/layout/style/nsCSSRule.cpp +++ b/mozilla/layout/style/nsCSSRule.cpp @@ -40,7 +40,7 @@ #include "nsIArena.h" #include "nsICSSStyleSheet.h" -void* nsCSSRule::operator new(size_t size) +void* nsCSSRule::operator new(size_t size) CPP_THROW_NEW { nsCSSRule* rv = (nsCSSRule*) ::operator new(size); #ifdef NS_DEBUG @@ -52,7 +52,7 @@ void* nsCSSRule::operator new(size_t size) return (void*) rv; } -void* nsCSSRule::operator new(size_t size, nsIArena* aArena) +void* nsCSSRule::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { nsCSSRule* rv = (nsCSSRule*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index 1ffc740d67e..c530259e6b2 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -201,7 +201,7 @@ struct RuleValue { } // Placement new to arena allocate the RuleValues - void *operator new(size_t aSize, PLArenaPool &aArena) { + void *operator new(size_t aSize, PLArenaPool &aArena) CPP_THROW_NEW { void *mem; PL_ARENA_ALLOCATE(mem, &aArena, aSize); return mem; @@ -1722,7 +1722,7 @@ void CSSStyleSheetInner::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz // CSS Style Sheet // -void* CSSStyleSheetImpl::operator new(size_t size) +void* CSSStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -1734,7 +1734,7 @@ void* CSSStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* CSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { CSSStyleSheetImpl* rv = (CSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp index 79f4fd1d5c3..99131ec6756 100644 --- a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp @@ -286,7 +286,7 @@ protected: }; -void* HTMLCSSStyleSheetImpl::operator new(size_t size) +void* HTMLCSSStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -298,7 +298,7 @@ void* HTMLCSSStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* HTMLCSSStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { HTMLCSSStyleSheetImpl* rv = (HTMLCSSStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index 68b139e0a32..095443e8e2c 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -898,7 +898,7 @@ protected: }; -void* HTMLStyleSheetImpl::operator new(size_t size) +void* HTMLStyleSheetImpl::operator new(size_t size) CPP_THROW_NEW { HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) ::operator new(size); #ifdef NS_DEBUG @@ -910,7 +910,7 @@ void* HTMLStyleSheetImpl::operator new(size_t size) return (void*) rv; } -void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) +void* HTMLStyleSheetImpl::operator new(size_t size, nsIArena* aArena) CPP_THROW_NEW { HTMLStyleSheetImpl* rv = (HTMLStyleSheetImpl*) aArena->Alloc(PRInt32(size)); #ifdef NS_DEBUG diff --git a/mozilla/layout/style/nsIStyleRuleProcessor.h b/mozilla/layout/style/nsIStyleRuleProcessor.h index 3c51832ceb2..c3e7cb4c1f4 100644 --- a/mozilla/layout/style/nsIStyleRuleProcessor.h +++ b/mozilla/layout/style/nsIStyleRuleProcessor.h @@ -68,7 +68,7 @@ struct RuleProcessorData { // NOTE: not |virtual| ~RuleProcessorData(); - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 249b8dd0c23..acbea6cee98 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -74,7 +74,7 @@ public: mNext->Destroy(mNext->mRuleNode->mPresContext); } - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -374,7 +374,7 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) +nsRuleNode::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/layout/style/nsRuleNode.h b/mozilla/layout/style/nsRuleNode.h index d0233b7b336..de717bb8617 100644 --- a/mozilla/layout/style/nsRuleNode.h +++ b/mozilla/layout/style/nsRuleNode.h @@ -68,7 +68,7 @@ struct nsInheritedStyleData nsStyleSVG* mSVGData; #endif - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -142,7 +142,7 @@ struct nsResetStyleData #endif }; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index 33794fe4f52..4eea9ad0fff 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -1249,7 +1249,7 @@ void nsStyleContext::DumpRegressionData(nsIPresContext* aPresContext, FILE* out, // Overloaded new operator. Initializes the memory to 0 and relies on an arena // (which comes from the presShell) to perform the allocation. void* -nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) +nsStyleContext::operator new(size_t sz, nsIPresContext* aPresContext) CPP_THROW_NEW { // Check the recycle list first. void* result = nsnull; diff --git a/mozilla/layout/style/nsStyleSet.cpp b/mozilla/layout/style/nsStyleSet.cpp index 48245cf8e28..5e8e0c68886 100644 --- a/mozilla/layout/style/nsStyleSet.cpp +++ b/mozilla/layout/style/nsStyleSet.cpp @@ -84,7 +84,7 @@ struct nsRuleNodeList :mRuleNode(aRuleNode), mNext(aNext) {}; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index 53c01b71e2f..22381d99ced 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -234,7 +234,7 @@ nsStyleFont::nsStyleFont(const nsStyleFont& aSrc) } void* -nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleFont::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -315,7 +315,7 @@ nsStyleMargin::nsStyleMargin(const nsStyleMargin& aSrc) { } void* -nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleMargin::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -374,7 +374,7 @@ nsStylePadding::nsStylePadding(const nsStylePadding& aSrc) { } void* -nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) { +nsStylePadding::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) @@ -474,7 +474,7 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc) } void* -nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) { +nsStyleBorder::operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); if (result) diff --git a/mozilla/layout/style/nsStyleStruct.h b/mozilla/layout/style/nsStyleStruct.h index 2e281c4d0d7..39c530afc3d 100644 --- a/mozilla/layout/style/nsStyleStruct.h +++ b/mozilla/layout/style/nsStyleStruct.h @@ -162,7 +162,7 @@ struct nsStyleColor : public nsStyleStruct { PRInt32 CalcDifference(const nsStyleColor& aOther) const; - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -184,7 +184,7 @@ struct nsStyleBackground : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Background) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -504,7 +504,7 @@ struct nsStyleOutline: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Outline) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -588,7 +588,7 @@ struct nsStyleList : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_List) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -613,7 +613,7 @@ struct nsStylePosition : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Position) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -643,7 +643,7 @@ struct nsStyleTextReset : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TextReset) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -670,7 +670,7 @@ struct nsStyleText : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Text) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -703,7 +703,7 @@ struct nsStyleVisibility : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Visibility) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -737,7 +737,7 @@ struct nsStyleDisplay : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Display) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -791,7 +791,7 @@ struct nsStyleTable: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Table) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -817,7 +817,7 @@ struct nsStyleTableBorder: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_TableBorder) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -868,7 +868,7 @@ struct nsStyleQuotes : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Quotes) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -929,7 +929,7 @@ struct nsStyleContent: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_Content) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1068,7 +1068,7 @@ struct nsStyleUIReset: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UIReset) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1093,7 +1093,7 @@ struct nsStyleUserInterface: public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_UserInterface) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1121,7 +1121,7 @@ struct nsStyleXUL : public nsStyleStruct { NS_DEFINE_STATIC_STYLESTRUCTID_ACCESSOR(eStyleStruct_XUL) - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; @@ -1160,7 +1160,7 @@ struct nsStyleSVG : public nsStyleStruct { nsStyleSVG(const nsStyleSVG& aSource); ~nsStyleSVG(); - void* operator new(size_t sz, nsIPresContext* aContext) { + void* operator new(size_t sz, nsIPresContext* aContext) CPP_THROW_NEW { void* result = nsnull; aContext->AllocateFromShell(sz, &result); return result; diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index e256ef62b6b..5d98a1e6fcc 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -2226,7 +2226,7 @@ nsBoxFrame::GetContentOf(nsIContent** aContent) void* -nsBoxFrameInner::operator new(size_t sz, nsIPresShell* aPresShell) +nsBoxFrameInner::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { return nsBoxLayoutState::Allocate(sz,aPresShell); } diff --git a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp index e17812e7881..7933a6d4509 100644 --- a/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp +++ b/mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp @@ -230,7 +230,7 @@ nsBoxToBlockAdaptor::SetStyleChangeFlag(PRBool aDirty) void* -nsBoxToBlockAdaptor::operator new(size_t sz, nsIPresShell* aPresShell) +nsBoxToBlockAdaptor::operator new(size_t sz, nsIPresShell* aPresShell) CPP_THROW_NEW { return nsBoxLayoutState::Allocate(sz,aPresShell); } diff --git a/mozilla/layout/xul/base/src/nsSprocketLayout.cpp b/mozilla/layout/xul/base/src/nsSprocketLayout.cpp index 7447eacad5d..7ee033fc37b 100644 --- a/mozilla/layout/xul/base/src/nsSprocketLayout.cpp +++ b/mozilla/layout/xul/base/src/nsSprocketLayout.cpp @@ -1709,7 +1709,7 @@ nsBoxSize::Clear() void* -nsBoxSize::operator new(size_t sz, nsBoxLayoutState& aState) +nsBoxSize::operator new(size_t sz, nsBoxLayoutState& aState) CPP_THROW_NEW { void* mem = 0; aState.AllocateStackMemory(sz,&mem); @@ -1724,7 +1724,7 @@ nsBoxSize::operator delete(void* aPtr, size_t sz) void* -nsComputedBoxSize::operator new(size_t sz, nsBoxLayoutState& aState) +nsComputedBoxSize::operator new(size_t sz, nsBoxLayoutState& aState) CPP_THROW_NEW { void* mem = 0; diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp index a2cc9a2395a..1503ea5ec9c 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeContentView.cpp @@ -142,7 +142,7 @@ class Row private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} // State flags diff --git a/mozilla/mailnews/compose/src/nsMsgZapIt.cpp b/mozilla/mailnews/compose/src/nsMsgZapIt.cpp index ea0053b2dce..64aba2827f3 100644 --- a/mozilla/mailnews/compose/src/nsMsgZapIt.cpp +++ b/mozilla/mailnews/compose/src/nsMsgZapIt.cpp @@ -39,7 +39,7 @@ #include "nsCRT.h" #if defined(XP_OS2) && defined(__DEBUG_ALLOC__) -void* nsMsgZapIt::operator new(size_t size, const char *file, size_t line) { +void* nsMsgZapIt::operator new(size_t size, const char *file, size_t line) CPP_THROW_NEW { void* rv = ::operator new(size, file, line); if (rv) { memset(rv, 0, size); @@ -47,7 +47,7 @@ void* nsMsgZapIt::operator new(size_t size, const char *file, size_t line) { return rv; } #else -void* nsMsgZapIt::operator new(size_t size) { +void* nsMsgZapIt::operator new(size_t size) CPP_THROW_NEW { void* rv = ::operator new(size); if (rv) { memset(rv, 0, size); diff --git a/mozilla/parser/htmlparser/public/nsToken.h b/mozilla/parser/htmlparser/public/nsToken.h index ef76dce0c4e..32d16413653 100644 --- a/mozilla/parser/htmlparser/public/nsToken.h +++ b/mozilla/parser/htmlparser/public/nsToken.h @@ -122,7 +122,7 @@ class CToken { * @param aSize - * @param aArena - Allocate memory from this pool. */ - static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena) + static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena) CPP_THROW_NEW { return anArena.Alloc(aSize); } diff --git a/mozilla/parser/htmlparser/src/nsParserNode.h b/mozilla/parser/htmlparser/src/nsParserNode.h index 3afdad7745b..98705d2dbf6 100644 --- a/mozilla/parser/htmlparser/src/nsParserNode.h +++ b/mozilla/parser/htmlparser/src/nsParserNode.h @@ -90,7 +90,7 @@ class nsCParserNode : public nsIParserNode { /** * Hide operator new; clients should use Create() instead. */ - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } /** * Hide operator delete; clients should use Destroy() instead. diff --git a/mozilla/rdf/base/src/nsCompositeDataSource.cpp b/mozilla/rdf/base/src/nsCompositeDataSource.cpp index ee2d868841d..0c61e6865dc 100644 --- a/mozilla/rdf/base/src/nsCompositeDataSource.cpp +++ b/mozilla/rdf/base/src/nsCompositeDataSource.cpp @@ -411,7 +411,7 @@ private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; @@ -530,7 +530,7 @@ private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; diff --git a/mozilla/rdf/base/src/nsInMemoryDataSource.cpp b/mozilla/rdf/base/src/nsInMemoryDataSource.cpp index 802a23291b2..db6bd86e37f 100644 --- a/mozilla/rdf/base/src/nsInMemoryDataSource.cpp +++ b/mozilla/rdf/base/src/nsInMemoryDataSource.cpp @@ -188,7 +188,7 @@ public: private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} }; @@ -420,7 +420,7 @@ private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} InMemoryAssertionEnumeratorImpl(InMemoryDataSource* aDataSource, @@ -616,7 +616,7 @@ class InMemoryArcsEnumeratorImpl : public nsISimpleEnumerator private: // Hide so that only Create() and Destroy() can be used to // allocate and deallocate from the heap - static void* operator new(size_t) { return 0; } + static void* operator new(size_t) CPP_THROW_NEW { return 0; } static void operator delete(void*, size_t) {} InMemoryDataSource* mDataSource; diff --git a/mozilla/tools/leaky/leaky.cpp b/mozilla/tools/leaky/leaky.cpp index 15bd132c64d..0cf20322c88 100644 --- a/mozilla/tools/leaky/leaky.cpp +++ b/mozilla/tools/leaky/leaky.cpp @@ -708,10 +708,7 @@ void leaky::dumpLeakTree(TreeNode* aNode, int aIndent) TreeNode* TreeNode::freeList; -void* TreeNode::operator new(size_t size) -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - throw() -#endif +void* TreeNode::operator new(size_t size) CPP_THROW_NEW { if (!freeList) { TreeNode* newNodes = (TreeNode*) new char[sizeof(TreeNode) * 5000]; diff --git a/mozilla/tools/leaky/leaky.h b/mozilla/tools/leaky/leaky.h index b3f8ff99084..1e561a26ef9 100644 --- a/mozilla/tools/leaky/leaky.h +++ b/mozilla/tools/leaky/leaky.h @@ -50,11 +50,7 @@ struct TreeNode { u_long bytesLeaked; u_long descendantBytesLeaked; - void* operator new(size_t size) -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - throw() -#endif - ; + void* operator new(size_t size) CPP_THROW_NEW ; void operator delete(void* ptr); static TreeNode* freeList; diff --git a/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp index d1b73218556..b9e27c79c27 100644 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ b/mozilla/xpcom/ds/nsAtomTable.cpp @@ -202,7 +202,7 @@ PermanentAtomImpl::IsPermanent() return PR_TRUE; } -void* AtomImpl::operator new ( size_t size, const nsAString& aString ) +void* AtomImpl::operator new ( size_t size, const nsAString& aString ) CPP_THROW_NEW { /* Note: since the |size| will initially also include the |PRUnichar| member @@ -222,7 +222,7 @@ void* AtomImpl::operator new ( size_t size, const nsAString& aString ) return ii; } -void* PermanentAtomImpl::operator new ( size_t size, AtomImpl* aAtom ) { +void* PermanentAtomImpl::operator new ( size_t size, AtomImpl* aAtom ) CPP_THROW_NEW { NS_ASSERTION(!aAtom->IsPermanent(), "converting atom that's already permanent"); diff --git a/mozilla/xpcom/ds/nsAtomTable.h b/mozilla/xpcom/ds/nsAtomTable.h index 6c620665715..e10f8fadfbe 100644 --- a/mozilla/xpcom/ds/nsAtomTable.h +++ b/mozilla/xpcom/ds/nsAtomTable.h @@ -84,7 +84,7 @@ public: virtual PRBool IsPermanent(); - void* operator new(size_t size, const nsAString& aString) { + void* operator new(size_t size, const nsAString& aString) CPP_THROW_NEW { return AtomImpl::operator new(size, aString); } void* operator new(size_t size, AtomImpl* aAtom); diff --git a/mozilla/xpcom/ds/nsCRT.h b/mozilla/xpcom/ds/nsCRT.h index 88b0289e8ab..81e0e704f6c 100644 --- a/mozilla/xpcom/ds/nsCRT.h +++ b/mozilla/xpcom/ds/nsCRT.h @@ -64,7 +64,7 @@ extern const PRUnichar kIsoLatin1ToUCS2[256]; // This macro can be used in a class declaration for classes that want // to ensure that their instance memory is zeroed. #define NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW \ - void* operator new(size_t sz) { \ + void* operator new(size_t sz) CPP_THROW_NEW { \ void* rv = ::operator new(sz); \ if (rv) { \ memset(rv, 0, sz); \ @@ -82,7 +82,7 @@ extern const PRUnichar kIsoLatin1ToUCS2[256]; void operator delete(void* ptr); #define NS_IMPL_ZEROING_OPERATOR_NEW(_class) \ - void* _class::operator new(size_t sz) { \ + void* _class::operator new(size_t sz) CPP_THROW_NEW { \ void* rv = ::operator new(sz); \ if (rv) { \ memset(rv, 0, sz); \ diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h index d8e89603b23..9bb3a54cace 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -173,7 +173,7 @@ private: xptiTypelibGuts(); // not implemented xptiTypelibGuts(XPTHeader* aHeader); ~xptiTypelibGuts() {} - void* operator new(size_t, void* p) {return p;} + void* operator new(size_t, void* p) CPP_THROW_NEW {return p;} private: XPTHeader* mHeader; // hold pointer into arena @@ -467,7 +467,7 @@ public: } private: - void* operator new(size_t, void* p) {return p;} + void* operator new(size_t, void* p) CPP_THROW_NEW {return p;} xptiInterfaceGuts(XPTInterfaceDescriptor* aDescriptor, const xptiTypelib& aTypelib, xptiWorkingSet* aWorkingSet) @@ -639,7 +639,7 @@ private: const xptiTypelib& typelib); ~xptiInterfaceEntry(); - void* operator new(size_t, void* p) {return p;} + void* operator new(size_t, void* p) CPP_THROW_NEW {return p;} void SetResolvedState(int state) {mFlags.SetState(uint8(state));} diff --git a/mozilla/xpcom/threads/nsAutoLock.h b/mozilla/xpcom/threads/nsAutoLock.h index cc4c4ce41ec..591bddc0bb2 100644 --- a/mozilla/xpcom/threads/nsAutoLock.h +++ b/mozilla/xpcom/threads/nsAutoLock.h @@ -152,11 +152,7 @@ private: // Not meant to be implemented. This makes it a compiler error to // attempt to create an nsAutoLock object on the heap. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - static void* operator new(size_t /*size*/) throw () { -#else - static void* operator new(size_t /*size*/) { -#endif + static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nsnull; } static void operator delete(void* /*memory*/) {} @@ -313,11 +309,7 @@ private: // Not meant to be implemented. This makes it a compiler error to // attempt to create an nsAutoLock object on the heap. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - static void* operator new(size_t /*size*/) throw () { -#else - static void* operator new(size_t /*size*/) { -#endif + static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nsnull; } static void operator delete(void* /*memory*/) {} @@ -384,11 +376,7 @@ private: // Not meant to be implemented. This makes it a compiler error to // attempt to create an nsAutoLock object on the heap. -#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) - static void* operator new(size_t /*size*/) throw() { -#else - static void* operator new(size_t /*size*/) { -#endif + static void* operator new(size_t /*size*/) CPP_THROW_NEW { return nsnull; } static void operator delete(void* /*memory*/) {} diff --git a/mozilla/xpcom/threads/nsThread.cpp b/mozilla/xpcom/threads/nsThread.cpp index 3f9c8bae6b3..247d2935f9e 100644 --- a/mozilla/xpcom/threads/nsThread.cpp +++ b/mozilla/xpcom/threads/nsThread.cpp @@ -453,7 +453,7 @@ public: ~nsThreadPoolBusyBody(); private: - void* operator new(size_t) { return 0; } // local variable, only! + void* operator new(size_t) CPP_THROW_NEW { return 0; } // local variable, only! nsThreadPool *mPool; };