Add CPP_THROW_NEW macro to the build system. This macro should be used when defining a local |operator new| function. It will be set to an empty throw function by default on all platforms except mac CW builds. This will allow us to not crash on systems that expect |operator new| to throw an exception by default and will suppress compiler warnings about how |operator new| should throw an exception instead of returning NULL.

Bug 149032 r=timeless sr=scc
This commit is contained in:
seawood%netscape.com 2002-07-02 20:25:30 +00:00
Родитель 4364bb25f9
Коммит 03ace271f0
87 изменённых файлов: 186 добавлений и 218 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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_ */

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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)

Просмотреть файл

@ -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) {}
};

Просмотреть файл

@ -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) {}
};

Просмотреть файл

@ -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) { };
};

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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:

Просмотреть файл

@ -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); }
};

Просмотреть файл

@ -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

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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); }

Просмотреть файл

@ -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); }

Просмотреть файл

@ -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); }

Просмотреть файл

@ -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); }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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:

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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 ();
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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:

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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:

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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)

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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) {}
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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];

Просмотреть файл

@ -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;

Просмотреть файл

@ -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");

Просмотреть файл

@ -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);

Просмотреть файл

@ -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); \

Просмотреть файл

@ -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));}

Просмотреть файл

@ -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*/) {}

Просмотреть файл

@ -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;
};