datarace: fixup, properly document BIT48
authorBrian Norris <banorris@uci.edu>
Fri, 13 Jul 2012 06:15:58 +0000 (23:15 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 13 Jul 2012 06:15:58 +0000 (23:15 -0700)
The "48-bit virtual address" macro should be checked with #if, not #ifdef,
since it's defined to 1 or 0. You would use #ifdef if it's either "define" or
"not defined." Make this clear in the comment as well.

config.h
datarace.cc

index 31ae7a416000a4abfc069034bcb611625ff95a28..ed305311a2b9e2306f46e88743f0cf6cd8da1f24 100644 (file)
--- a/config.h
+++ b/config.h
@@ -4,8 +4,9 @@
 
 #ifndef CONFIG_H
 #define CONFIG_H
-/** Do we have a 48 bit virtual address (64 bit machine) or 32 bit addresses */
-#define BIT48 1
 
+/** Do we have a 48 bit virtual address (64 bit machine) or 32 bit addresses.
+ * Set to 1 for 48-bit, 0 for 32-bit. */
+#define BIT48 1
 
 #endif
index 294b6b919ad224b8c6633491555db1d6c132c002..f0d3dc619489d780ea7e9be237b2007d428a4b33 100644 (file)
@@ -14,7 +14,7 @@ void initRaceDetector() {
  * given address.*/
 static uint64_t * lookupAddressEntry(void * address) {
        struct ShadowTable *currtable=root;
-#ifdef BIT48
+#if BIT48
        currtable=(struct ShadowTable *) currtable->array[(((uintptr_t)address)>>32)&MASK16BIT];
        if (currtable==NULL) {
                currtable=(struct ShadowTable *) (root->array[(((uintptr_t)address)>>32)&MASK16BIT]=calloc(sizeof(struct ShadowTable),1));