]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Repack dns_rbtnode struct to gain some space (reduce packing holes) (#41854)
authorMukund Sivaraman <muks@isc.org>
Mon, 7 Mar 2016 10:41:37 +0000 (16:11 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 7 Mar 2016 10:48:02 +0000 (16:18 +0530)
(cherry picked from commit 8dbf9ceb8c41fd55dfe9b1ecd12e0952b463a49b)
(cherry picked from commit 2a461f13481e2d5aaf12253df9f1097c28badeb1)

lib/dns/include/dns/rbt.h

index 61b7a04e7e9c72e9d9f7ac35f282c467e9613541..41e4e31b0b42d135943876c1ec9af33f724be914 100644 (file)
@@ -80,22 +80,6 @@ struct dns_rbtnode {
 #if DNS_RBT_USEMAGIC
        unsigned int magic;
 #endif
-       dns_rbtnode_t *parent;
-       dns_rbtnode_t *left;
-       dns_rbtnode_t *right;
-       dns_rbtnode_t *down;
-#ifdef DNS_RBT_USEHASH
-       dns_rbtnode_t *uppernode;
-       dns_rbtnode_t *hashnext;
-#endif
-
-       /*%
-        * Used for LRU cache.  This linked list is used to mark nodes which
-        * have no data any longer, but we cannot unlink at that exact moment
-        * because we did not or could not obtain a write lock on the tree.
-        */
-       ISC_LINK(dns_rbtnode_t) deadlink;
-
        /*@{*/
        /*!
         * The following bitfields add up to a total bitwidth of 32.
@@ -119,9 +103,32 @@ struct dns_rbtnode {
        /* node needs to be cleaned from rpz */
        unsigned int rpz : 1;
 
+       /*@{*/
+       /*!
+        * These values are used in the RBT DB implementation.  The appropriate
+        * node lock must be held before accessing them.
+        */
+       unsigned int dirty:1;
+       unsigned int wild:1;
+       unsigned int locknum:DNS_RBT_LOCKLENGTH;
+       /*@}*/
+
 #ifdef DNS_RBT_USEHASH
        unsigned int hashval;
+       dns_rbtnode_t *uppernode;
+       dns_rbtnode_t *hashnext;
 #endif
+       dns_rbtnode_t *parent;
+       dns_rbtnode_t *left;
+       dns_rbtnode_t *right;
+       dns_rbtnode_t *down;
+
+       /*%
+        * Used for LRU cache.  This linked list is used to mark nodes which
+        * have no data any longer, but we cannot unlink at that exact moment
+        * because we did not or could not obtain a write lock on the tree.
+        */
+       ISC_LINK(dns_rbtnode_t) deadlink;
 
        /*@{*/
        /*!
@@ -129,9 +136,6 @@ struct dns_rbtnode {
         * node lock must be held before accessing them.
         */
        void *data;
-       unsigned int dirty:1;
-       unsigned int wild:1;
-       unsigned int locknum:DNS_RBT_LOCKLENGTH;
 #ifndef DNS_RBT_USEISCREFCOUNT
        unsigned int references:DNS_RBT_REFLENGTH;
 #else