]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/kru nit: shrink the USE_AES version of struct kru by 64 bytes
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 6 Aug 2025 14:09:25 +0000 (16:09 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 13 Aug 2025 11:42:33 +0000 (13:42 +0200)
Just by dropping some padding in the header.
Also drop a long outdated part of comment on this.

lib/kru.inc.c

index d5d2baac05ddce0ac60cdcc2fce880f75e047d2b..b556f168026906c21ad302d0601819292c9e3fe7 100644 (file)
@@ -83,7 +83,8 @@ struct load_cl {
 static_assert(64 == sizeof(struct load_cl), "bad size of struct load_cl");
 
 /// Parametrization for speed of decay.
-struct decay_config {
+//  Packed to allow unpadded following by more data in the USE_AES version of struct kru.
+struct __attribute__((packed)) decay_config {
        /// Bit shift per tick, fractional
        double shift_bits;
 
@@ -96,7 +97,7 @@ struct decay_config {
 struct kru {
 #if USE_AES
        /// Hashing secret.  Random but shared by all users of the table.
-       /// Let's not make it too large, so that header fits into 64 Bytes.
+       /// Let's not make it too large.
        _Alignas(32) char hash_key[48];
 #else
        /// Hashing secret.  Random but shared by all users of the table.