From d60f9efd0c8a3a66144b0763cb69ad85f3501746 Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Wed, 5 Jul 2006 14:42:47 +0000 Subject: [PATCH] Added default new operators to the F_Object class - ones without file and line number. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@633 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- ftk/src/ftk.h | 17 +++++++++++++++++ ftk/src/ftkmem.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/ftk/src/ftk.h b/ftk/src/ftk.h index 57bd92c..04d135a 100644 --- a/ftk/src/ftk.h +++ b/ftk/src/ftk.h @@ -861,6 +861,14 @@ throw() #endif ; + + /// Overloaded new operator for objects of this class. + void * FLMAPI operator new( + FLMSIZET uiSize) ///< Number of bytes to allocate - should be sizeof( ThisClass). +#ifndef FLM_WATCOM_NLM + throw() +#endif + ; /// Overloaded new operator (array) for objects of this class (with source file and line number). /// This new operator is called when an array of objects of this class are allocated. @@ -875,6 +883,15 @@ #endif ; + /// Overloaded new operator (array) for objects of this class. + /// This new operator is called when an array of objects of this class are allocated. + void * FLMAPI operator new[]( + FLMSIZET uiSize) ///< Number of bytes to allocate - should be sizeof( ThisClass). +#ifndef FLM_WATCOM_NLM + throw() +#endif + ; + /// Overloaded delete operator for objects of this class. void FLMAPI operator delete( void * ptr); ///< Pointer to object being freed. diff --git a/ftk/src/ftkmem.cpp b/ftk/src/ftkmem.cpp index a86f7a0..10f32bd 100644 --- a/ftk/src/ftkmem.cpp +++ b/ftk/src/ftkmem.cpp @@ -5598,6 +5598,21 @@ void * F_Object::operator new( return( pvReturnPtr); } +/**************************************************************************** +Desc: +****************************************************************************/ +void * F_Object::operator new( + FLMSIZET uiSize) +#ifndef FLM_WATCOM_NLM + throw() +#endif +{ + void * pvReturnPtr = NULL; + + f_allocImp( uiSize, &pvReturnPtr, TRUE, NULL, 0); + return( pvReturnPtr); +} + /**************************************************************************** Desc: ****************************************************************************/ @@ -5615,6 +5630,21 @@ void * F_Object::operator new[]( return( pvReturnPtr); } +/**************************************************************************** +Desc: +****************************************************************************/ +void * F_Object::operator new[]( + FLMSIZET uiSize) +#ifndef FLM_WATCOM_NLM + throw() +#endif +{ + void * pvReturnPtr = NULL; + + f_allocImp( uiSize, &pvReturnPtr, TRUE, NULL, 0); + return( pvReturnPtr); +} + /**************************************************************************** Desc: ****************************************************************************/