From b2dc04393adaa09b6ff91e4d31b72e0ba6621a53 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Fri, 21 Apr 2017 17:31:33 +0900 Subject: Align pool allocator with 8 byte in 64-bit environment. To avoid warnings from undefined sanitizer. ( https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html ) --- src/pool.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pool.c') diff --git a/src/pool.c b/src/pool.c index 18f66fc27..db4546abf 100644 --- a/src/pool.c +++ b/src/pool.c @@ -13,8 +13,12 @@ /* allocated memory address should be multiple of POOL_ALIGNMENT */ /* or undef it if alignment does not matter */ #ifndef POOL_ALIGNMENT +#if INTPTR_MAX == INT64_MAX +#define POOL_ALIGNMENT 8 +#else #define POOL_ALIGNMENT 4 #endif +#endif /* page size of memory pool */ #ifndef POOL_PAGE_SIZE #define POOL_PAGE_SIZE 16000 -- cgit v1.2.3