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

ruby-changes:65337

From: Peter <ko1@a...>
Date: Thu, 25 Feb 2021 05:25:48 +0900 (JST)
Subject: [ruby-changes:65337] a80366c922 (master): Disable auto compaction on platforms that do not support it

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

From a80366c922c5ad3ce27870d92ffbec5ce292ec31 Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
Date: Tue, 23 Feb 2021 16:29:53 -0500
Subject: Disable auto compaction on platforms that do not support it

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

diff --git a/gc.c b/gc.c
index daffb8e..073d1bc 100644
--- a/gc.c
+++ b/gc.c
@@ -9986,6 +9986,13 @@ gc_set_auto_compact(rb_execution_context_t *ec, VALUE _, VALUE v) https://github.com/ruby/ruby/blob/trunk/gc.c#L9986
         rb_raise(rb_eNotImpError, "Automatic compaction isn't available on this platform");
     }
 #endif
+
+    /* If not MinGW, Windows, or does not have mmap, we cannot use mprotect for
+     * the read barrier, so we must disable automatic compaction. */
+#if !defined(__MINGW32__) && !defined(_WIN32) && !defined(HAVE_MMAP)
+    rb_raise(rb_eNotImpError, "Automatic compaction isn't available on this platform");
+#endif
+
     ruby_enable_autocompact = RTEST(v);
     return v;
 }
-- 
cgit v1.1


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

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