From f2f00e24fa14b8114d6c3bea11170b2b3e309719 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sat, 19 Dec 2020 22:29:16 -0500 Subject: [ruby/date] Make Ractor-compatible --- ext/date/date_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/date') diff --git a/ext/date/date_core.c b/ext/date/date_core.c index c6bceb1354..38deba6034 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -2977,7 +2977,7 @@ static const rb_data_type_t d_lite_type = { "Date", {d_lite_gc_mark, RUBY_TYPED_DEFAULT_FREE, d_lite_memsize,}, 0, 0, - RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED, + RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED|RUBY_TYPED_FROZEN_SHAREABLE, }; inline static VALUE @@ -9118,6 +9118,9 @@ d_lite_zero(VALUE x) void Init_date_core(void) { + #ifdef HAVE_RB_EXT_RACTOR_SAFE + RB_EXT_RACTOR_SAFE(true); + #endif id_cmp = rb_intern_const("<=>"); id_le_p = rb_intern_const("<="); id_ge_p = rb_intern_const(">="); -- cgit v1.2.3