use placement new

This commit is contained in:
Jeff Hill
2002-10-23 23:23:22 +00:00
parent 37d239eb88
commit 6026533aeb
4 changed files with 183 additions and 92 deletions

View File

@@ -19,18 +19,25 @@
* Author: Jeff Hill
*/
#include <stdexcept>
#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
epicsSingleton < tsFreeList < struct oldSubscription, 1024 > > oldSubscription::pFreeList;
oldSubscription::~oldSubscription ()
{
}
void oldSubscription::ioCancel ()
{
if ( this->subscribed ) {
this->chan.ioCancel ( this->id );
}
}
void oldSubscription::current (
unsigned type, arrayElementCount count, const void *pData)
unsigned type, arrayElementCount count, const void * pData )
{
struct event_handler_args args;
@@ -48,7 +55,8 @@ void oldSubscription::exception (
unsigned type, arrayElementCount count )
{
if ( status == ECA_CHANDESTROY ) {
delete this;
ca_client_context & cac = this->chan.getClientCtx ();
cac.destroySubscription ( *this );
}
else if ( status != ECA_DISCONN ) {
struct event_handler_args args;
@@ -62,3 +70,9 @@ void oldSubscription::exception (
}
}
void oldSubscription::operator delete ( void *pCadaver )
{
throw std::logic_error
( "compiler is confused about placement delete" );
}