diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index e086f0757..b3c7d5de9 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -103,10 +103,11 @@ const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] = // // cac::cac () // -cac::cac ( cacNotify ¬ifyIn, bool enablePreemptiveCallbackIn ) : +cac::cac ( cacNotify ¬ifyIn, bool enablePreemptiveCallbackIn, + unsigned maxNumberOfChannels ) : ipToAEngine ( "caIPAddrToAsciiEngine" ), - chanTable ( 16384 ), - ioTable ( 16384 ), + chanTable ( maxNumberOfChannels ), + ioTable ( maxNumberOfChannels ), sgTable ( 128 ), beaconTable ( 1024 ), pudpiiu ( 0 ), @@ -913,7 +914,8 @@ cacChannel::ioid cac::writeNotifyRequest ( nciu &chan, unsigned type, unsigned n } } -cacChannel::ioid cac::readNotifyRequest ( nciu &chan, unsigned type, unsigned nElem, cacReadNotify ¬ifyIn ) +cacChannel::ioid cac::readNotifyRequest ( nciu &chan, unsigned type, + unsigned nElem, cacReadNotify ¬ifyIn ) { epicsAutoMutex autoMutex ( this->mutex ); autoPtrRecycle < netReadNotifyIO > pIO ( *this, netReadNotifyIO::factory ( diff --git a/src/ca/cac.h b/src/ca/cac.h index 4adc9f8af..004c63acf 100644 --- a/src/ca/cac.h +++ b/src/ca/cac.h @@ -99,7 +99,8 @@ struct caHdrLargeArray; class cac : private cacRecycle { public: - cac ( cacNotify &, bool enablePreemptiveCallback = false ); + cac ( cacNotify &, bool enablePreemptiveCallback = false, + unsigned maxNumberOfChannels = 32768 ); virtual ~cac (); // beacon management diff --git a/src/ca/cadef.h b/src/ca/cadef.h index 2d94b83f7..650112eff 100644 --- a/src/ca/cadef.h +++ b/src/ca/cadef.h @@ -194,7 +194,8 @@ epicsShareFunc enum channel_state epicsShareAPI ca_state (chid chan); /* Must be called once before calling any of the other routines */ /************************************************************************/ epicsShareFunc int epicsShareAPI ca_task_initialize (void); -epicsShareFunc int epicsShareAPI ca_context_create ( int preemptiveCallBackEnable ); +epicsShareFunc int epicsShareAPI ca_context_create ( + int preemptiveCallBackEnable, unsigned maxNumberOfChannels ); /************************************************************************/ /* Remove CA facility from your task */ diff --git a/src/ca/catime.c b/src/ca/catime.c index 92e98fe9c..c7f310a89 100644 --- a/src/ca/catime.c +++ b/src/ca/catime.c @@ -484,7 +484,7 @@ LOCAL void test ( */ int catime ( char *channelName, unsigned channelCount, enum appendNumberFlag appNF ) { - unsigned i; + unsigned i; unsigned strsize; unsigned nBytes; ti *pItemList; @@ -494,7 +494,7 @@ int catime ( char *channelName, unsigned channelCount, enum appendNumberFlag app return -1; } - SEVCHK ( ca_task_initialize(),"Unable to initialize" ); + SEVCHK ( ca_context_create ( 0, channelCount * 2 ), "Unable to initialize" ); if ( appNF == appendNumber ) { printf ( "Testing with %u channels named %snnn\n",