summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-14 09:31:09 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-14 09:31:09 +0900
commita168c4772827bc6105177c4b605dcf6e6e1943a5 (patch)
tree7c79afacd141870a0432a90429d207984855e924
parent434cd3c399d2213ad319b7e203af0b07a1d0d64f (diff)
Make USE_MMAP_ALIGNED_ALLOC static const
-rw-r--r--gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index c98aaee4d3..365210b377 100644
--- a/gc.c
+++ b/gc.c
@@ -858,10 +858,10 @@ enum {
#ifdef HAVE_MMAP
# if HAVE_CONST_PAGE_SIZE
/* If we have the HEAP_PAGE and it is a constant, then we can directly use it. */
-# define USE_MMAP_ALIGNED_ALLOC (PAGE_SIZE <= HEAP_PAGE_SIZE)
+static const bool USE_MMAP_ALIGNED_ALLOC = (PAGE_SIZE <= HEAP_PAGE_SIZE);
# elif defined(PAGE_MAX_SIZE) && (PAGE_MAX_SIZE <= HEAP_PAGE_SIZE)
/* PAGE_SIZE <= HEAP_PAGE_SIZE */
-# define USE_MMAP_ALIGNED_ALLOC 1
+static const bool USE_MMAP_ALIGNED_ALLOC = true;
# else
/* Otherwise, fall back to determining if we can use mmap during runtime. */
# define USE_MMAP_ALIGNED_ALLOC (use_mmap_aligned_alloc != false)
@@ -869,7 +869,7 @@ enum {
static bool use_mmap_aligned_alloc;
# endif
#else
-# define USE_MMAP_ALIGNED_ALLOC 0
+static const bool USE_MMAP_ALIGNED_ALLOC = false;
#endif
struct heap_page {