From 31f557d779a11dd4175598aeafb2bdd53a10e367 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Fri, 26 Feb 1999 19:57:18 +0000 Subject: [PATCH] use macro to get operator new correct git-svn-id: svn://10.0.0.236/trunk@22203 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/robot/nsRobotSink.cpp | 6 +----- mozilla/parser/htmlparser/robot/nsRobotSink.cpp | 6 +----- mozilla/view/src/nsView.h | 7 +------ mozilla/view/src/nsViewManager.h | 6 +----- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/mozilla/htmlparser/robot/nsRobotSink.cpp b/mozilla/htmlparser/robot/nsRobotSink.cpp index f9074a2afd4..1fb2c0292d0 100644 --- a/mozilla/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/htmlparser/robot/nsRobotSink.cpp @@ -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 diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp index f9074a2afd4..1fb2c0292d0 100644 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp @@ -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 diff --git a/mozilla/view/src/nsView.h b/mozilla/view/src/nsView.h index 1fed6ac41e0..cb83285ad55 100644 --- a/mozilla/view/src/nsView.h +++ b/mozilla/view/src/nsView.h @@ -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); diff --git a/mozilla/view/src/nsViewManager.h b/mozilla/view/src/nsViewManager.h index c0b00cb11b4..1962094857a 100644 --- a/mozilla/view/src/nsViewManager.h +++ b/mozilla/view/src/nsViewManager.h @@ -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