From: Brian Norris Date: Fri, 13 Jul 2012 06:15:58 +0000 (-0700) Subject: datarace: fixup, properly document BIT48 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=82a487f5efd48d3ec5f35a72e826100371731506 datarace: fixup, properly document BIT48 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. --- diff --git a/config.h b/config.h index 31ae7a41..ed305311 100644 --- 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 diff --git a/datarace.cc b/datarace.cc index 294b6b91..f0d3dc61 100644 --- a/datarace.cc +++ b/datarace.cc @@ -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));