static void expandRecord(uint64_t * shadow) {
uint64_t shadowval=*shadow;
- int readClock = READVECTOR(shadowval);
+ modelclock_t readClock = READVECTOR(shadowval);
thread_id_t readThread = int_to_id(RDTHREADID(shadowval));
- int writeClock = WRITEVECTOR(shadowval);
+ modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
struct RaceRecord * record=(struct RaceRecord *)calloc(1,sizeof(struct RaceRecord));
if (readClock!=0) {
record->capacity=INITCAPACITY;
record->thread=(thread_id_t *) malloc(sizeof(thread_id_t)*record->capacity);
- record->readClock=(int *) malloc(sizeof(int)*record->capacity);
+ record->readClock=(modelclock_t *) malloc(sizeof(modelclock_t)*record->capacity);
record->numReads=1;
record->thread[0]=readThread;
record->readClock[0]=readClock;
/* Check for datarace against last read. */
for(int i=0;i<record->numReads;i++) {
- int readClock = record->readClock[i];
+ modelclock_t readClock = record->readClock[i];
thread_id_t readThread = record->thread[i];
if (readThread != thread && readClock != 0 && currClock->getClock(readThread) <= readClock) {
/* Check for datarace against last write. */
- int writeClock = record->writeClock;
+ modelclock_t writeClock = record->writeClock;
thread_id_t writeThread = record->writeThread;
if (writeThread != thread && writeClock != 0 && currClock->getClock(writeThread) <= writeClock) {
record->numReads=0;
record->writeThread=thread;
- int ourClock = currClock->getClock(thread);
+ modelclock_t ourClock = currClock->getClock(thread);
record->writeClock=ourClock;
}
}
int threadid = id_to_int(thread);
- int ourClock = currClock->getClock(thread);
+ modelclock_t ourClock = currClock->getClock(thread);
/* Thread ID is too large or clock is too large. */
if (threadid > MAXTHREADID || ourClock > MAXWRITEVECTOR) {
/* Check for datarace against last read. */
- int readClock = READVECTOR(shadowval);
+ modelclock_t readClock = READVECTOR(shadowval);
thread_id_t readThread = int_to_id(RDTHREADID(shadowval));
if (readThread != thread && readClock != 0 && currClock->getClock(readThread) <= readClock) {
/* Check for datarace against last write. */
- int writeClock = WRITEVECTOR(shadowval);
+ modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
if (writeThread != thread && writeClock != 0 && currClock->getClock(writeThread) <= writeClock) {
/* Check for datarace against last write. */
- int writeClock = record->writeClock;
+ modelclock_t writeClock = record->writeClock;
thread_id_t writeThread = record->writeThread;
if (writeThread != thread && writeClock != 0 && currClock->getClock(writeThread) <= writeClock) {
int copytoindex=0;
for(int i=0;i<record->numReads;i++) {
- int readClock = record->readClock[i];
+ modelclock_t readClock = record->readClock[i];
thread_id_t readThread = record->thread[i];
if (readThread != thread && currClock->getClock(readThread) <= readClock) {
if (copytoindex>=record->capacity) {
int newCapacity=record->capacity*2;
thread_id_t *newthread=(thread_id_t *) malloc(sizeof(thread_id_t)*newCapacity);
- int * newreadClock=(int *) malloc(sizeof(int)*newCapacity);
+ modelclock_t * newreadClock=(modelclock_t *) malloc(sizeof(modelclock_t)*newCapacity);
std::memcpy(newthread, record->thread, record->capacity*sizeof(thread_id_t));
- std::memcpy(newreadClock, record->readClock, record->capacity*sizeof(int));
+ std::memcpy(newreadClock, record->readClock, record->capacity*sizeof(modelclock_t));
free(record->readClock);
free(record->thread);
record->readClock=newreadClock;
record->capacity=newCapacity;
}
- int ourClock = currClock->getClock(thread);
+ modelclock_t ourClock = currClock->getClock(thread);
record->thread[copytoindex]=thread;
record->readClock[copytoindex]=ourClock;
}
int threadid = id_to_int(thread);
- int ourClock = currClock->getClock(thread);
+ modelclock_t ourClock = currClock->getClock(thread);
/* Thread ID is too large or clock is too large. */
if (threadid > MAXTHREADID || ourClock > MAXWRITEVECTOR) {
/* Check for datarace against last write. */
- int writeClock = WRITEVECTOR(shadowval);
+ modelclock_t writeClock = WRITEVECTOR(shadowval);
thread_id_t writeThread = int_to_id(WRTHREADID(shadowval));
if (writeThread != thread && writeClock != 0 && currClock->getClock(writeThread) <= writeClock) {
reportDataRace();
}
- int readClock = READVECTOR(shadowval);
+ modelclock_t readClock = READVECTOR(shadowval);
thread_id_t readThread = int_to_id(RDTHREADID(shadowval));
if (readThread != thread && readClock != 0 && currClock->getClock(readThread) <= readClock) {