X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=datarace.cc;h=9c403668e90d7c0fbe6ff76cda3cc3f1a2c37d81;hb=7742256df627848c1c375f979f5369a45c92057b;hp=544fced0485690e67aabee2d56f8fcbf47d16b1c;hpb=509ea2631fffda65d966c4ddd1e18a5c2eda89c0;p=c11tester.git diff --git a/datarace.cc b/datarace.cc index 544fced0..9c403668 100644 --- a/datarace.cc +++ b/datarace.cc @@ -55,7 +55,7 @@ void * table_calloc(size_t size) /** This function looks up the entry in the shadow table corresponding to a * given address.*/ -static uint64_t * lookupAddressEntry(const void *address) +static inline uint64_t * lookupAddressEntry(const void *address) { struct ShadowTable *currtable = root; #if BIT48 @@ -500,7 +500,7 @@ void recordWrite(thread_id_t thread, void *location) { /** This function just updates metadata on atomic write. */ void recordCalloc(void *location, size_t size) { - thread_id_t thread = thread_current()->get_id(); + thread_id_t thread = thread_current_id(); for(;size != 0;size--) { uint64_t *shadow = lookupAddressEntry(location); uint64_t shadowval = *shadow; @@ -558,9 +558,9 @@ struct DataRace * fullRaceCheckRead(thread_id_t thread, const void *location, ui if (clock_may_race(currClock, thread, readClock, readThread)) { /* Still need this read in vector */ if (copytoindex != i) { - ASSERT(record->thread[i] >= 0); - record->readClock[copytoindex] = record->readClock[i]; - record->thread[copytoindex] = record->thread[i]; + ASSERT(readThread >= 0); + record->readClock[copytoindex] = readClock; + record->thread[copytoindex] = readThread; } copytoindex++; }