use macro to get operator new correct

git-svn-id: svn://10.0.0.236/trunk@22203 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com 1999-02-26 19:57:18 +00:00
parent 2e06c0f14a
commit 31f557d779
4 changed files with 4 additions and 21 deletions

View File

@ -42,11 +42,7 @@ public:
RobotSink();
~RobotSink();
void* operator new(size_t size) {
void* rv = ::operator new(size);
nsCRT::zero(rv, size);
return (void*) rv;
}
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
// nsISupports
NS_DECL_ISUPPORTS

View File

@ -42,11 +42,7 @@ public:
RobotSink();
~RobotSink();
void* operator new(size_t size) {
void* rv = ::operator new(size);
nsCRT::zero(rv, size);
return (void*) rv;
}
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
// nsISupports
NS_DECL_ISUPPORTS

View File

@ -36,12 +36,7 @@ class nsView : public nsIView
public:
nsView();
// Overloaded new operator. Initializes the memory to 0
void* operator new(size_t sz) {
void* rv = new char[sz];
nsCRT::zero(rv, sz);
return rv;
}
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

View File

@ -35,11 +35,7 @@ class nsViewManager : public nsIViewManager
public:
nsViewManager();
void* operator new(size_t sz) {
void* rv = new char[sz];
nsCRT::zero(rv, sz);
return rv;
}
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
NS_DECL_ISUPPORTS