From: Vsevolod Stakhov Date: Mon, 1 Jun 2015 16:14:56 +0000 (+0100) Subject: Align pointers by 16 bytes boundary. X-Git-Tag: 1.0.0~580 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ea297d18f73e96247af1081993a05a36f75ccee;p=thirdparty%2Frspamd.git Align pointers by 16 bytes boundary. 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. --- diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h index 7e71925ced..1befd8445b 100644 --- a/src/libutil/mem_pool.h +++ b/src/libutil/mem_pool.h @@ -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))