Skip to content

Commit

Permalink
Align pool allocator with 8 byte in 64-bit environment.
Browse files Browse the repository at this point in the history
To avoid warnings from undefined sanitizer.
( https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html )
  • Loading branch information
take-cheeze committed Apr 21, 2017
1 parent 94bcdca commit b2dc043
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2dc043

Please sign in to comment.