commit 06b7034: [Minor] Improve align_ptr macro
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Dec 23 18:49:08 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-12-23 15:54:05 +0000
URL: https://github.com/rspamd/rspamd/commit/06b703488213c534f3430a03cd60952254e6b661
[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,
More information about the Commits
mailing list