]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Split access to wild and dirty from locknum to silence TSAN warnings.
authorMark Andrews <marka@isc.org>
Wed, 20 Nov 2019 07:04:01 +0000 (18:04 +1100)
committerMark Andrews <marka@isc.org>
Mon, 25 Nov 2019 05:21:52 +0000 (16:21 +1100)
lib/dns/include/dns/rbt.h

index 3e18e71c84ef0f1e2586fb21361a570becd368e9..0a0e3091603f031a192da1774558cb2984f787b4 100644 (file)
@@ -40,11 +40,8 @@ ISC_LANG_BEGINDECLS
 
 #define DNS_RBT_USEMAGIC 1
 
-/*
- * These should add up to 30.
- */
-#define DNS_RBT_LOCKLENGTH                      10
-#define DNS_RBT_REFLENGTH                       20
+#define DNS_RBT_LOCKLENGTH             (sizeof(((dns_rbtnode_t *)0)->locknum)*8)
+#define DNS_RBT_REFLENGTH              20
 
 #define DNS_RBTNODE_MAGIC               ISC_MAGIC('R','B','N','O')
 #if DNS_RBT_USEMAGIC
@@ -154,12 +151,12 @@ struct dns_rbtnode {
         * separate region of memory.
         */
        void *data;
-       unsigned int :0;                /* start of bitfields c/o node lock */
-       unsigned int dirty:1;
-       unsigned int wild:1;
-       unsigned int locknum:DNS_RBT_LOCKLENGTH;
-       unsigned int :0;                /* end of bitfields c/o node lock */
-       isc_refcount_t references; /* note that this is not in the bitfield */
+       uint8_t :0;                /* start of bitfields c/o node lock */
+       uint8_t dirty:1;
+       uint8_t wild:1;
+       uint8_t :0;                /* end of bitfields c/o node lock */
+       uint16_t locknum;          /* note that this is not in the bitfield */
+       isc_refcount_t references;
        /*@}*/
 };