free list use epicsSingleton
This commit is contained in:
@@ -66,7 +66,7 @@ private:
|
||||
unsigned long count;
|
||||
unsigned id;
|
||||
dbSubscriptionIO * isSubscription ();
|
||||
static epicsSingleton < tsFreeList < dbSubscriptionIO > > freeList;
|
||||
static epicsSingleton < tsFreeList < dbSubscriptionIO > > pFreeList;
|
||||
friend void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr *paddr,
|
||||
int eventsRemaining, struct db_field_log *pfl );
|
||||
dbSubscriptionIO ( const dbSubscriptionIO & );
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
void ioShow ( const ioid &, unsigned level ) const;
|
||||
short nativeType () const;
|
||||
unsigned long nativeElementCount () const;
|
||||
static epicsSingleton < tsFreeList < dbChannelIO > > freeList;
|
||||
static epicsSingleton < tsFreeList < dbChannelIO > > pFreeList;
|
||||
static unsigned nextIdForIO;
|
||||
dbChannelIO ( const dbChannelIO & );
|
||||
dbChannelIO & operator = ( const dbChannelIO & );
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "epicsSingleton.h"
|
||||
#include "db_access.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
@@ -29,7 +30,7 @@
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
tsFreeList < dbChannelIO > dbChannelIO::freeList;
|
||||
epicsSingleton < tsFreeList < dbChannelIO > > dbChannelIO::pFreeList;
|
||||
unsigned dbChannelIO::nextIdForIO;
|
||||
|
||||
dbChannelIO::dbChannelIO ( cacChannelNotify ¬ify,
|
||||
|
||||
@@ -32,12 +32,12 @@ inline void dbChannelIO::destroy ()
|
||||
|
||||
inline void * dbChannelIO::operator new ( size_t size )
|
||||
{
|
||||
return dbChannelIO::freeList.allocate ( size );
|
||||
return dbChannelIO::pFreeList->allocate ( size );
|
||||
}
|
||||
|
||||
inline void dbChannelIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
dbChannelIO::freeList.release ( pCadaver, size );
|
||||
dbChannelIO::pFreeList->release ( pCadaver, size );
|
||||
}
|
||||
|
||||
inline const char *dbChannelIO::pName () const
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "epicsEvent.h"
|
||||
#include "epicsTime.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
#include "errMdef.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
@@ -34,7 +35,7 @@
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "dbPutNotifyBlocker.h"
|
||||
|
||||
tsFreeList < dbPutNotifyBlocker, 1024, 0 > dbPutNotifyBlocker::freeList;
|
||||
epicsSingleton < tsFreeList < dbPutNotifyBlocker, 1024 > > dbPutNotifyBlocker::pFreeList;
|
||||
|
||||
dbPutNotifyBlocker::dbPutNotifyBlocker ( dbChannelIO &chanIn ) :
|
||||
pNotify ( 0 )
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
epicsEvent block;
|
||||
cacWriteNotify * pNotify;
|
||||
dbSubscriptionIO * isSubscription ();
|
||||
static epicsSingleton < tsFreeList < dbPutNotifyBlocker > > freeList;
|
||||
static epicsSingleton < tsFreeList < dbPutNotifyBlocker > > pFreeList;
|
||||
friend void putNotifyCompletion ( putNotify *ppn );
|
||||
dbPutNotifyBlocker ( const dbPutNotifyBlocker & );
|
||||
dbPutNotifyBlocker & operator = ( const dbPutNotifyBlocker & );
|
||||
@@ -44,12 +44,12 @@ private:
|
||||
|
||||
inline void * dbPutNotifyBlocker::operator new ( size_t size )
|
||||
{
|
||||
return dbPutNotifyBlocker::freeList.allocate ( size );
|
||||
return dbPutNotifyBlocker::pFreeList->allocate ( size );
|
||||
}
|
||||
|
||||
inline void dbPutNotifyBlocker::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
dbPutNotifyBlocker::freeList.release ( pCadaver, size );
|
||||
dbPutNotifyBlocker::pFreeList->release ( pCadaver, size );
|
||||
}
|
||||
|
||||
#endif // ifndef dbPutNotifyBlockerh
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
* Auther Jeff Hill
|
||||
*/
|
||||
|
||||
#include "epicsMutex.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "cadef.h" // this can be eliminated when the callbacks use the new interface
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsSingleton.h"
|
||||
|
||||
#include "cacIO.h"
|
||||
#include "db_access.h" // need to eliminate this
|
||||
@@ -30,7 +31,7 @@
|
||||
#include "dbChannelIOIL.h"
|
||||
#include "db_access_routines.h"
|
||||
|
||||
tsFreeList < dbSubscriptionIO > dbSubscriptionIO::freeList;
|
||||
epicsSingleton < tsFreeList < dbSubscriptionIO > > dbSubscriptionIO::pFreeList;
|
||||
|
||||
dbSubscriptionIO::dbSubscriptionIO ( dbServiceIO &serviceIO, dbChannelIO &chanIO,
|
||||
dbAddr &addr, cacStateNotify ¬ifyIn,
|
||||
@@ -79,12 +80,12 @@ void dbSubscriptionIO::channelDeleteException ()
|
||||
|
||||
void * dbSubscriptionIO::operator new ( size_t size )
|
||||
{
|
||||
return dbSubscriptionIO::freeList.allocate ( size );
|
||||
return dbSubscriptionIO::pFreeList->allocate ( size );
|
||||
}
|
||||
|
||||
void dbSubscriptionIO::operator delete ( void *pCadaver, size_t size )
|
||||
{
|
||||
dbSubscriptionIO::freeList.release ( pCadaver, size );
|
||||
dbSubscriptionIO::pFreeList->release ( pCadaver, size );
|
||||
}
|
||||
|
||||
extern "C" void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr * /* paddr */,
|
||||
|
||||
Reference in New Issue
Block a user