From: Marek P. <ma...@us...> - 2002-04-15 21:04:26
|
Update of /cvsroot/javaprofiler/library/src/commun In directory usw-pr-cvs1:/tmp/cvs-serv21227/src/commun Modified Files: iprof.cpp iprof.h Log Message: serious bug fixes - monitors, deactivating... interface version checking added new test program for testing of memory profiling added Index: iprof.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** iprof.cpp 4 Apr 2002 00:49:14 -0000 1.15 --- iprof.cpp 15 Apr 2002 21:04:17 -0000 1.16 *************** *** 89,92 **** --- 89,94 ---- Buffer buf; + int firstTime = 1; + while( 1) { *************** *** 99,116 **** Synchronized sync( communLock); ! buf.clear(); ! (*_commun) >> buf; ! if( _commun->hasFailed()) return (conEstabl = 0); ! jint naction = *(jint*)(buf.getBuffer()); ! jint action = ntohl( naction); // back to host-byte-order ! if( action < 0 || action >= FUNC_COUNT) return (conEstabl = 0); ! (this->*(_func[action]))( buf); ! (*_commun) << buf; ! if( _commun->hasFailed()) return (conEstabl = 0); } --- 101,138 ---- Synchronized sync( communLock); ! if( firstTime) { ! ! (*_commun) >> buf; ! if( _commun->hasFailed()) return (conEstabl = 0); ! ! jint version = ntohl( *(const jint*)buf.getBuffer()); ! ! buf.clear(); ! buf += (jint)INTERFACE_VERSION_NUMBER; ! ! (*_commun) << buf; ! if( _commun->hasFailed()) return (conEstabl = 0); ! ! if( version != INTERFACE_VERSION_NUMBER) return (conEstabl = 0); ! ! firstTime = 0; ! } ! else { ! buf.clear(); ! (*_commun) >> buf; ! if( _commun->hasFailed()) return (conEstabl = 0); ! jint naction = *(jint*)(buf.getBuffer()); ! jint action = ntohl( naction); // back to host-byte-order ! if( action < 0 || action >= FUNC_COUNT) return (conEstabl = 0); ! (this->*(_func[action]))( buf); ! ! (*_commun) << buf; ! if( _commun->hasFailed()) return (conEstabl = 0); ! } } Index: iprof.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** iprof.h 4 Apr 2002 00:49:14 -0000 1.17 --- iprof.h 15 Apr 2002 21:04:17 -0000 1.18 *************** *** 47,50 **** --- 47,53 ---- #include "../list/listItem.h" + /* PLEASE DO NOT FORGET TO INCREASE 'INTERFACE_VERSION_NUMBER' + * CONSTANT OF THIS CLASS WHEN YOU DO ANY CHANGES IN THE INTERFACE. */ + /** Communication interface class. This class implements ** the whole communication interface between this profiler *************** *** 65,68 **** --- 68,74 ---- /// constants enum e { + + /// version number of communication interface + INTERFACE_VERSION_NUMBER = 1, /// number of methods of the interface |