]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reduce the size of rdatasetheader_t by 16 bytes
authorTony Finch <fanf@isc.org>
Wed, 8 Feb 2023 13:18:34 +0000 (13:18 +0000)
committerTony Finch <dot@dotat.at>
Thu, 9 Feb 2023 09:07:30 +0000 (09:07 +0000)
Re-order the fields to avoid padding, and change the type of
`heap_index` to `uint16_t` to match `dns_rbtnode_t->locknum`.

CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index b94bee0b0d456566d1db1667b92ad7b89795bff0..7bc3e2f2feddd53a67c389acbb2989437572c8f7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+6091.  [performance]   Reduce the size of each rdataset header object
+                       by 16 bytes. [GL !7505]
+
 6092.  [bug]           dnssec-cds failed to cleanup properly. [GL #3831]
 
 6091.  [cleanup]       Drop RHEL 7 and clones support. [GL #3729]
index 4aa3c7b400297ed80f7354dbfa706df4f158cb09..45c282581e7a2b6764119c3043f80aa9873e4d39 100644 (file)
@@ -239,10 +239,26 @@ typedef struct rdatasetheader {
        rbtdb_rdatatype_t type;
        atomic_uint_least16_t attributes;
        dns_trust_t trust;
+
+       uint16_t heap_index;
+       /*%<
+        * Used for TTL-based cache cleaning. Matches type of dns_rbt_t->locknum
+        */
+
+       unsigned int resign_lsb : 1;
+       isc_stdtime_t resign;
+
        atomic_uint_fast32_t last_refresh_fail_ts;
+
+       atomic_uint_fast32_t count;
+       /*%<
+        * Monotonically increased every time this rdataset is bound so that
+        * it is used as the base of the starting point in DNS responses
+        * when the "cyclic" rrset-order is required.
+        */
+
        struct noqname *noqname;
        struct noqname *closest;
-       unsigned int resign_lsb : 1;
        /*%<
         * We don't use the LIST macros, because the LIST structure has
         * both head and tail pointers, and is doubly linked.
@@ -262,23 +278,11 @@ typedef struct rdatasetheader {
         * this rdataset.
         */
 
-       atomic_uint_fast32_t count;
-       /*%<
-        * Monotonously increased every time this rdataset is bound so that
-        * it is used as the base of the starting point in DNS responses
-        * when the "cyclic" rrset-order is required.
-        */
-
        dns_rbtnode_t *node;
        isc_stdtime_t last_used;
        ISC_LINK(struct rdatasetheader) link;
 
-       unsigned int heap_index;
-       /*%<
-        * Used for TTL-based cache cleaning.
-        */
-       isc_stdtime_t resign;
-       /*%<
+       /*%
         * Case vector.  If the bit is set then the corresponding
         * character in the owner name needs to be AND'd with 0x20,
         * rendering that character upper case.