diff options
author | Peter Zhu <peter@peterzhu.ca> | 2021-02-23 16:29:53 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-02-24 12:25:30 -0800 |
commit | a80366c922c5ad3ce27870d92ffbec5ce292ec31 (patch) | |
tree | 946695d212234fe8d2d9c3da831f01cc3312b6a8 | |
parent | 785f5eb8f0f994c755ac5f1e1479f6e2ec6d0ef3 (diff) |
Disable auto compaction on platforms that do not support it
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4221
-rw-r--r-- | gc.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -9986,6 +9986,13 @@ gc_set_auto_compact(rb_execution_context_t *ec, VALUE _, VALUE v) 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; } |