[前][次][番号順一覧][スレッド一覧]

ruby-changes:70654

From: Nobuyoshi <ko1@a...>
Date: Wed, 29 Dec 2021 20:54:05 +0900 (JST)
Subject: [ruby-changes:70654] 002fa28599 (master): On 64bit macOS, enlarge heap pages to reduce mmap calls [Bug #18447]

https://git.ruby-lang.org/ruby.git/commit/?id=002fa28599

From 002fa2859962f22de8afdbeece04966ea57b7da9 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 29 Dec 2021 16:15:36 +0900
Subject: On 64bit macOS, enlarge heap pages to reduce mmap calls [Bug #18447]

---
 gc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gc.c b/gc.c
index a5369c28f13..bbc5c40e90a 100644
--- a/gc.c
+++ b/gc.c
@@ -847,8 +847,15 @@ typedef struct rb_objspace { https://github.com/ruby/ruby/blob/trunk/gc.c#L847
 } rb_objspace_t;
 
 
+#if defined(__APPLE__) && defined(__LP64__) && !defined(HEAP_PAGE_ALIGN_LOG)
+/* for slow mmap: 64KiB */
+#define HEAP_PAGE_ALIGN_LOG 16
+#endif
+
+#ifndef HEAP_PAGE_ALIGN_LOG
 /* default tiny heap size: 16KB */
 #define HEAP_PAGE_ALIGN_LOG 14
+#endif
 #define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
 enum {
     HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]