diff --git a/src/ca/CASG.cpp b/src/ca/CASG.cpp index 4e600c22f..c0e71aae4 100644 --- a/src/ca/CASG.cpp +++ b/src/ca/CASG.cpp @@ -278,8 +278,13 @@ void CASG::exception ( int status, const char *pContext, void CASG::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/bhe.cpp b/src/ca/bhe.cpp index 94e5f5cef..dcc5ba844 100644 --- a/src/ca/bhe.cpp +++ b/src/ca/bhe.cpp @@ -248,8 +248,13 @@ void bhe::unregisterIIU ( tcpiiu & iiu ) void bhe::operator delete ( void * ) { - throw std::logic_error - ( "compiler is confused about placement delete?" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void * bheFreeStore::allocate ( size_t size ) diff --git a/src/ca/comBuf.cpp b/src/ca/comBuf.cpp index e4aae6a85..626ae50e0 100644 --- a/src/ca/comBuf.cpp +++ b/src/ca/comBuf.cpp @@ -133,8 +133,13 @@ void comBuf::throwInsufficentBytesException () void comBuf::operator delete ( void *pCadaver ) throw ( std::logic_error ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } comBufMemoryManager::~comBufMemoryManager () {} diff --git a/src/ca/getCallback.cpp b/src/ca/getCallback.cpp index 24957cbf7..4bc90ffb5 100644 --- a/src/ca/getCallback.cpp +++ b/src/ca/getCallback.cpp @@ -73,8 +73,13 @@ void getCallback::exception ( void getCallback::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/getCopy.cpp b/src/ca/getCopy.cpp index e7cf8c837..f7c4fe65a 100644 --- a/src/ca/getCopy.cpp +++ b/src/ca/getCopy.cpp @@ -90,7 +90,12 @@ void getCopy::show ( unsigned level ) const void getCopy::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/msgForMultiplyDefinedPV.cpp b/src/ca/msgForMultiplyDefinedPV.cpp index 87e970d54..f5335db5b 100644 --- a/src/ca/msgForMultiplyDefinedPV.cpp +++ b/src/ca/msgForMultiplyDefinedPV.cpp @@ -62,7 +62,12 @@ void msgForMultiplyDefinedPV::ioCompletionNotify ( const char * pHostNameRej ) void msgForMultiplyDefinedPV::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index 4ba522319..da0a3e58d 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -86,8 +86,13 @@ void nciu::destroy () void nciu::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void nciu::initiateConnect () diff --git a/src/ca/netReadNotifyIO.cpp b/src/ca/netReadNotifyIO.cpp index edf9e74c9..bc786f3b4 100644 --- a/src/ca/netReadNotifyIO.cpp +++ b/src/ca/netReadNotifyIO.cpp @@ -82,8 +82,13 @@ nciu & netReadNotifyIO::channel () const void netReadNotifyIO::operator delete ( void * p ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/netSubscription.cpp b/src/ca/netSubscription.cpp index 1e78864a6..97f408c72 100644 --- a/src/ca/netSubscription.cpp +++ b/src/ca/netSubscription.cpp @@ -95,8 +95,13 @@ nciu & netSubscription::channel () const void netSubscription::operator delete ( void * p ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/netWriteNotifyIO.cpp b/src/ca/netWriteNotifyIO.cpp index 972dc07ee..dd5a692fb 100644 --- a/src/ca/netWriteNotifyIO.cpp +++ b/src/ca/netWriteNotifyIO.cpp @@ -83,7 +83,12 @@ nciu & netWriteNotifyIO::channel () const void netWriteNotifyIO::operator delete ( void * p ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/oldChannelNotify.cpp b/src/ca/oldChannelNotify.cpp index d93e2caa2..5030e1656 100644 --- a/src/ca/oldChannelNotify.cpp +++ b/src/ca/oldChannelNotify.cpp @@ -185,7 +185,12 @@ void oldChannelNotify::writeException ( int status, const char *pContext, void oldChannelNotify::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/oldSubscription.cpp b/src/ca/oldSubscription.cpp index c7b231040..444325541 100644 --- a/src/ca/oldSubscription.cpp +++ b/src/ca/oldSubscription.cpp @@ -72,7 +72,12 @@ void oldSubscription::exception ( void oldSubscription::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/putCallback.cpp b/src/ca/putCallback.cpp index c92df5b97..45d577a9b 100644 --- a/src/ca/putCallback.cpp +++ b/src/ca/putCallback.cpp @@ -73,7 +73,12 @@ void putCallback::exception ( void putCallback::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/ca/repeater.cpp b/src/ca/repeater.cpp index 0060b4af9..912a97994 100644 --- a/src/ca/repeater.cpp +++ b/src/ca/repeater.cpp @@ -251,8 +251,13 @@ repeaterClient::~repeaterClient () inline void repeaterClient::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } inline void * repeaterClient::operator new ( size_t size, diff --git a/src/ca/syncGroupReadNotify.cpp b/src/ca/syncGroupReadNotify.cpp index 875ca195f..7e57f05e0 100644 --- a/src/ca/syncGroupReadNotify.cpp +++ b/src/ca/syncGroupReadNotify.cpp @@ -94,8 +94,13 @@ void syncGroupReadNotify::show ( unsigned level ) const void syncGroupReadNotify::operator delete ( void * p ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void * syncGroupReadNotify::operator new ( size_t size, diff --git a/src/ca/syncGroupWriteNotify.cpp b/src/ca/syncGroupWriteNotify.cpp index f8e911982..c8f99609b 100644 --- a/src/ca/syncGroupWriteNotify.cpp +++ b/src/ca/syncGroupWriteNotify.cpp @@ -88,8 +88,13 @@ void syncGroupWriteNotify::show ( unsigned level ) const void syncGroupWriteNotify::operator delete ( void * p ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void * syncGroupWriteNotify::operator new ( size_t size, diff --git a/src/cas/io/bsdSocket/ipIgnoreEntry.cpp b/src/cas/io/bsdSocket/ipIgnoreEntry.cpp index 8870e6b6f..61f1efe04 100644 --- a/src/cas/io/bsdSocket/ipIgnoreEntry.cpp +++ b/src/cas/io/bsdSocket/ipIgnoreEntry.cpp @@ -46,7 +46,13 @@ resTableIndex ipIgnoreEntry::hash () const void ipIgnoreEntry::operator delete ( void * pCadaver ) { - throw std::logic_error ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/db/dbChannelIO.cpp b/src/db/dbChannelIO.cpp index b4b6b02da..af2d51e46 100644 --- a/src/db/dbChannelIO.cpp +++ b/src/db/dbChannelIO.cpp @@ -123,8 +123,11 @@ void dbChannelIO::show ( unsigned level ) const void dbChannelIO::operator delete ( void *pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. } diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index 546779325..6b217c026 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -189,6 +189,11 @@ dbSubscriptionIO * dbPutNotifyBlocker::isSubscription () void dbPutNotifyBlocker::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/db/dbSubscriptionIO.cpp b/src/db/dbSubscriptionIO.cpp index 9f10dd6ab..3e0ea58a2 100644 --- a/src/db/dbSubscriptionIO.cpp +++ b/src/db/dbSubscriptionIO.cpp @@ -81,8 +81,13 @@ void dbSubscriptionIO::channelDeleteException () void dbSubscriptionIO::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void * dbSubscriptionIO::operator new ( size_t size, diff --git a/src/libCom/timer/epicsTimer.h b/src/libCom/timer/epicsTimer.h index 513930733..16de291c2 100644 --- a/src/libCom/timer/epicsTimer.h +++ b/src/libCom/timer/epicsTimer.h @@ -50,7 +50,6 @@ public: class epicsTimer { // X aCC 655 public: - virtual ~epicsTimer () = 0; virtual void destroy () = 0; virtual void start ( epicsTimerNotify &, const epicsTime & ) = 0; virtual void start ( epicsTimerNotify &, double delaySeconds ) = 0; @@ -63,11 +62,8 @@ public: virtual expireInfo getExpireInfo () const = 0; double getExpireDelay (); virtual void show ( unsigned int level ) const = 0; -private: - void * operator new ( size_t ); - void * operator new [] ( size_t ); - void operator delete ( void * ); - void operator delete [] ( void * ); +protected: + virtual ~epicsTimer () = 0; // protected => delete() must not be called }; class epicsTimerQueue { // X aCC 655 @@ -86,11 +82,6 @@ public: virtual void release () = 0; protected: virtual ~epicsTimerQueueActive () = 0; -private: - void * operator new ( size_t ); - void * operator new [] ( size_t ); - void operator delete ( void * ); - void operator delete [] ( void * ); }; class epicsTimerQueueNotify { // X aCC 655 diff --git a/src/libCom/timer/timer.cpp b/src/libCom/timer/timer.cpp index 58932fc3b..8a9fee4e4 100644 --- a/src/libCom/timer/timer.cpp +++ b/src/libCom/timer/timer.cpp @@ -49,7 +49,7 @@ void timer::destroy () { timerQueue & queueTmp ( this->queue ); this->~timer (); - timer::operator delete ( this, queueTmp.timerFreeList ) ; + //timer::operator delete ( this, queueTmp.timerFreeList ) ; } void timer::start ( epicsTimerNotify & notify, double delaySeconds ) @@ -225,13 +225,23 @@ void timer::show ( unsigned int level ) const void timer::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } void epicsTimerForC::operator delete ( void * pCadaver ) { - throw std::logic_error - ( "compiler is confused about placement delete" ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. + errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked", + __FILE__, __LINE__ ); } diff --git a/src/libCom/timer/timerPrivate.h b/src/libCom/timer/timerPrivate.h index bed566e826..f29f87cb8 100644 --- a/src/libCom/timer/timerPrivate.h +++ b/src/libCom/timer/timerPrivate.h @@ -55,6 +55,11 @@ private: epicsTimerNotify * pNotify; // callback void privateStart ( epicsTimerNotify & notify, const epicsTime & ); timer & operator = ( const timer & ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. void * operator new ( size_t size ); void operator delete ( void * ); friend class timerQueue; @@ -75,6 +80,11 @@ private: void * pPrivate; expireStatus expire ( const epicsTime & currentTime ); epicsTimerForC & operator = ( const epicsTimerForC & ); + // Visual C++ .net appears to require operator delete if + // placement operator delete is defined? I smell a ms rat + // because if I declare placement new and delete, but + // comment out the placement delete definition there are + // no undefined symbols. void * operator new ( size_t size ); void operator delete ( void * ); friend class timerQueue; @@ -119,14 +129,13 @@ class timerQueueActive : public epicsTimerQueueActive, public timerQueueActiveMgrPrivate { public: timerQueueActive ( bool okToShare, unsigned priority ); - virtual ~timerQueueActive () = 0; epicsTimer & createTimer (); epicsTimerForC & createTimerForC ( epicsTimerCallback pCallback, void *pArg ); void show ( unsigned int level ) const; bool sharingOK () const; unsigned threadPriority () const; - void * operator new ( size_t ); - void operator delete ( void * ); +protected: + virtual ~timerQueueActive () = 0; private: timerQueue queue; epicsEvent rescheduleEvent; @@ -178,7 +187,7 @@ public: epicsTimerQueuePassiveForC ( epicsTimerQueueRescheduleCallback pCallback, void *pPrivate ); void destroy (); protected: - virtual ~epicsTimerQueuePassiveForC (); + ~epicsTimerQueuePassiveForC (); private: epicsTimerQueueRescheduleCallback pCallback; void *pPrivate;