From 8999fe55692a89dc0326b58fda5286247a2cae77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 6 Aug 2025 16:09:25 +0200 Subject: [PATCH] lib/kru nit: shrink the USE_AES version of struct kru by 64 bytes Just by dropping some padding in the header. Also drop a long outdated part of comment on this. --- lib/kru.inc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kru.inc.c b/lib/kru.inc.c index d5d2baac0..b556f1680 100644 --- a/lib/kru.inc.c +++ b/lib/kru.inc.c @@ -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. -- 2.47.2