Optimize on aligned memory access
[c11tester.git] / datarace.h
index 296118a2d6b305c3dad1da850e338a9c67983b94..eed0e1711fbcadb5bc9a2858f4138f23b31c95e4 100644 (file)
@@ -111,12 +111,13 @@ bool race_equals(struct DataRace *r1, struct DataRace *r2);
  */
 #define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 7) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<38))
 
-#define INVALIDSHADOWVAL 0x2ULL
-
 #define MAXTHREADID (THREADMASK-1)
 #define MAXREADVECTOR (READMASK-1)
 #define MAXWRITEVECTOR (WRITEMASK-1)
 
+#define INVALIDSHADOWVAL 0x2ULL
+#define CHECKBOUNDARY(location, bits) ( (((uintptr_t)location & MASK16BIT) + bits < MASK16BIT) ? true : false );
+
 typedef HashSet<struct DataRace *, uintptr_t, 0, model_malloc, model_calloc, model_free, race_hash, race_equals> RaceSet;
 
 #endif /* __DATARACE_H__ */