dont use a free list

This commit is contained in:
Jeff Hill
2002-10-23 23:35:42 +00:00
parent bfe985e7aa
commit 340e0c1d58
2 changed files with 9 additions and 15 deletions

View File

@@ -30,8 +30,6 @@
#include "iocinf.h"
#include "hostNameCache.h"
epicsSingleton < tsFreeList < hostNameCache, 16 > > hostNameCache::pFreeList;
hostNameCache::hostNameCache ( const osiSockAddr &addr, ipAddrToAsciiEngine &engine ) :
ipAddrToAsciiAsynchronous ( addr ),
ioComplete ( false )
@@ -68,12 +66,3 @@ void hostNameCache::hostName ( char *pBuf, unsigned bufSize ) const
}
}
void * hostNameCache::operator new ( size_t size )
{
return hostNameCache::pFreeList->allocate ( size );
}
void hostNameCache::operator delete ( void *pCadaver, size_t size )
{
hostNameCache::pFreeList->release ( pCadaver, size );
}

View File

@@ -27,9 +27,17 @@
#ifndef hostNameCacheh
#define hostNameCacheh
#ifdef epicsExportSharedSymbols
# define hostNameCache_epicsExportSharedSymbols
# undef epicsExportSharedSymbols
#endif
#include "ipAddrToAsciiAsynchronous.h"
#include "tsFreeList.h"
#include "epicsSingleton.h"
#ifdef hostNameCache_epicsExportSharedSymbols
# define epicsExportSharedSymbols
#endif
class hostNameCache : public ipAddrToAsciiAsynchronous {
public:
@@ -38,12 +46,9 @@ public:
void destroy ();
void ioCompletionNotify ( const char *pHostName );
void hostName ( char *pBuf, unsigned bufLength ) const;
void * operator new ( size_t size );
void operator delete ( void *pCadaver, size_t size );
private:
bool ioComplete;
char hostNameBuf [128];
static epicsSingleton < tsFreeList < class hostNameCache, 16 > > pFreeList;
};
#endif // #ifndef hostNameCacheh