ruby-changes:66203
From: Nobuyoshi <ko1@a...>
Date: Fri, 14 May 2021 09:40:03 +0900 (JST)
Subject: [ruby-changes:66203] a168c47728 (master): Make USE_MMAP_ALIGNED_ALLOC static const
https://git.ruby-lang.org/ruby.git/commit/?id=a168c47728 From a168c4772827bc6105177c4b605dcf6e6e1943a5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 14 May 2021 09:31:09 +0900 Subject: Make USE_MMAP_ALIGNED_ALLOC static const --- gc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gc.c b/gc.c index c98aaee..365210b 100644 --- a/gc.c +++ b/gc.c @@ -858,10 +858,10 @@ enum { https://github.com/ruby/ruby/blob/trunk/gc.c#L858 #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 { https://github.com/ruby/ruby/blob/trunk/gc.c#L869 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 { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/