]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Align pointers by 16 bytes boundary.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 1 Jun 2015 16:14:56 +0000 (17:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 1 Jun 2015 16:14:56 +0000 (17:14 +0100)
Many operations on x86 are much faster if the pointers are aligned
properly. Obviously, that would increase memory usage slightly, however,
rspamd always prefers speed to compactness.

src/libutil/mem_pool.h

index 7e71925ced7e3e2fb290e244fce6dcf5269a7265..1befd8445b0e466f7953e2ecfe4f7ab677620270 100644 (file)
@@ -19,7 +19,7 @@
 
 struct f_str_s;
 
-#define MEM_ALIGNMENT   sizeof(unsigned long)    /* platform word */
+#define MEM_ALIGNMENT   16    /* Better for SSE */
 #define align_ptr(p, a)                                                   \
        (guint8 *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))