non need to specify hash table size

This commit is contained in:
Jeff Hill
2001-06-15 22:39:01 +00:00
parent 759b1a3541
commit ca76832387
7 changed files with 18 additions and 21 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ LOCAL void asCaTask(void)
int status;
taskwdInsert(epicsThreadGetIdSelf(),NULL,NULL);
SEVCHK(ca_context_create(enablePreemption,1024),
SEVCHK(ca_context_create(enablePreemption),
"asCaTask calling ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
"ca_add_exception_event");
+4 -5
View File
@@ -88,11 +88,10 @@ int fetchClientContext ( oldCAC **ppcac )
*/
extern "C" int epicsShareAPI ca_task_initialize ( void )
{
return ca_context_create ( false, 32768 );
return ca_context_create ( false );
}
extern "C" int epicsShareAPI ca_context_create (
int preemptiveCallBackEnable, unsigned maxNumberOfChannels )
extern "C" int epicsShareAPI ca_context_create ( int preemptiveCallBackEnable )
{
oldCAC *pcac;
@@ -102,12 +101,12 @@ extern "C" int epicsShareAPI ca_context_create (
return ECA_ALLOCMEM;
}
pcac = (oldCAC *) epicsThreadPrivateGet ( caClientContextId );
pcac = ( oldCAC * ) epicsThreadPrivateGet ( caClientContextId );
if ( pcac ) {
return ECA_NORMAL;
}
pcac = new oldCAC ( preemptiveCallBackEnable ? true : false, maxNumberOfChannels );
pcac = new oldCAC ( preemptiveCallBackEnable ? true : false );
if ( ! pcac ) {
return ECA_ALLOCMEM;
}
+1 -1
View File
@@ -648,7 +648,7 @@ void dbCaTask()
int status;
taskwdInsert(epicsThreadGetIdSelf(),NULL,NULL);
SEVCHK(ca_context_create(enablePreemption,32768),
SEVCHK(ca_context_create(enablePreemption),
"dbCaTask calling ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
"ca_add_exception_event");
+1 -1
View File
@@ -52,7 +52,7 @@ dbServiceIOLoadTimeInit::dbServiceIOLoadTimeInit ()
}
dbServiceIO::dbServiceIO () :
ioTable ( 1024 ), eventCallbackCacheSize ( 0ul ),
eventCallbackCacheSize ( 0ul ),
ctx ( 0 ), pEventCallbackCache ( 0 )
{
}
+3 -4
View File
@@ -80,18 +80,17 @@ epicsShareDef fdManager fileDescriptorManager;
//
inline const unsigned fdRegId::minIndexBitWidth ()
{
return hashTableIndexBits;
return fdManagerHashTableMinIndexBits;
}
inline const unsigned fdRegId::maxIndexBitWidth ()
{
return sizeof(SOCKET)*CHAR_BIT;
return fdManagerHashTableMaxIndexBits;
}
//
// fdManager::fdManager()
//
epicsShareFunc fdManager::fdManager () :
fdTbl ( 1<<hashTableIndexBits ), pTimerQueue ( 0 )
epicsShareFunc fdManager::fdManager () : pTimerQueue ( 0 )
{
size_t i;
int status;
+7 -6
View File
@@ -43,8 +43,6 @@
#include "osiSock.h"
#include "epicsTimer.h"
static const unsigned hashTableIndexBits = 8;
enum fdRegType {fdrRead, fdrWrite, fdrException, fdrNEnums};
//
@@ -74,7 +72,7 @@ public:
return this->fd == idIn.fd && this->type==idIn.type;
}
resTableIndex hash (unsigned nBitsId) const;
resTableIndex hash () const;
static const unsigned minIndexBitWidth ();
static const unsigned maxIndexBitWidth ();
@@ -175,15 +173,18 @@ private:
fdManager &manager;
};
static const unsigned fdManagerHashTableMinIndexBits = 8;
static const unsigned fdManagerHashTableMaxIndexBits = sizeof(SOCKET)*CHAR_BIT;
//
// fdRegId::hash()
//
inline resTableIndex fdRegId::hash (unsigned) const
inline resTableIndex fdRegId::hash () const
{
resTableIndex hashid;
hashid = intId<SOCKET, hashTableIndexBits, sizeof(SOCKET)*CHAR_BIT>
::hashEngine(this->fd);
hashid = integerHash < fdManagerHashTableMinIndexBits,
fdManagerHashTableMaxIndexBits > ( this->fd );
//
// also evenly distribute based on the type of fdRegType
+1 -3
View File
@@ -149,9 +149,7 @@ epicsTimerNotify::expireStatus timerForOldFdmgr::expire ( const epicsTime & )
return noRestart;
}
oldFdmgr::oldFdmgr () : resTbl (1024)
{
}
oldFdmgr::oldFdmgr () {}
extern "C" epicsShareFunc fdctx * epicsShareAPI fdmgr_init (void)
{