]> git.kaiwu.me - haproxy.git/commitdiff
OPTIM: acl: always keep the local sample 64-byte aligned
authorWilly Tarreau <w@1wt.eu>
Mon, 30 Nov 2026 18:55:29 +0000 (19:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 1 Dec 2026 07:17:13 +0000 (08:17 +0100)
Better have this sample aligned in the stack, it's used for literally
every match and it experiences a memset(0) for each of them. Having it
aligned encourages the compiler to use SIMD instructions instead of
rep stos to clear it.

src/acl.c

index 40043f5375d8044838f80d6adbfaa145949d020e..806aab4cfc1c168e67ce0399f38ab907d1ac7a70 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -1048,7 +1048,7 @@ enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct
        struct acl_term *term;
        struct acl_expr *expr;
        struct acl *acl;
-       struct sample smp;
+       struct sample smp ALIGNED(64);
        enum acl_test_res acl_res, suite_res, cond_res;
 
        /* ACLs are iterated over all values, so let's always set the flag to