ruby-changes:65342
From: Peter <ko1@a...>
Date: Fri, 26 Feb 2021 04:02:10 +0900 (JST)
Subject: [ruby-changes:65342] 1c0e79e87b (master): Disable auto compaction on platforms that do not support it
https://git.ruby-lang.org/ruby.git/commit/?id=1c0e79e87b From 1c0e79e87b202ac707833fb1bd5e9398c8d0b4fb 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 2a0fa80..d1a9174 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/