use placement new

This commit is contained in:
Jeff Hill
2002-10-23 22:58:49 +00:00
parent 0817ad51ba
commit 37d239eb88
5 changed files with 105 additions and 66 deletions

View File

@@ -24,12 +24,12 @@
* 505 665 1831
*/
#include <stdexcept>
#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
epicsSingleton < tsFreeList < class putCallback, 1024 > > putCallback::pFreeList;
putCallback::putCallback ( oldChannelNotify &chanIn,
caEventCallBackFunc *pFuncIn, void *pPrivateIn ) :
chan ( chanIn ), pFunc ( pFuncIn ), pPrivate ( pPrivateIn )
@@ -51,7 +51,7 @@ void putCallback::completion ()
args.status = ECA_NORMAL;
args.dbr = 0;
( *this->pFunc ) (args);
delete this;
this->chan.getClientCtx().destroyPutCallback ( *this );
}
void putCallback::exception (
@@ -68,7 +68,12 @@ void putCallback::exception (
args.dbr = 0;
( *this->pFunc ) (args);
}
delete this;
this->chan.getClientCtx().destroyPutCallback ( *this );
}
void putCallback::operator delete ( void * pCadaver )
{
throw std::logic_error
( "compiler is confused about placement delete" );
}