From 06b703488213c534f3430a03cd60952254e6b661 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 23 Dec 2019 15:54:05 +0000 Subject: [PATCH] [Minor] Improve align_ptr macro --- src/libutil/mem_pool_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/mem_pool_internal.h b/src/libutil/mem_pool_internal.h index 9341fce08..e7a5ecaf2 100644 --- a/src/libutil/mem_pool_internal.h +++ b/src/libutil/mem_pool_internal.h @@ -22,7 +22,7 @@ */ #define align_ptr(p, a) \ - (guint8 *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1)) + ((guint8 *) ((uintptr_t) (p) + ((-(intptr_t)(p)) & ((a) - 1)))) enum rspamd_mempool_chain_type { RSPAMD_MEMPOOL_NORMAL = 0, -- 2.39.5