summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-19 22:29:16 -0500
committerMarc-André Lafortune <github@marc-andre.ca>2020-12-22 03:12:51 -0500
commitf2f00e24fa14b8114d6c3bea11170b2b3e309719 (patch)
tree928bab79d8c7c97c0793a0c844578376d7e6148b /ext/date
parentee102de6d7ec2454dc5da223483737478eb7bcc7 (diff)
[ruby/date] Make Ractor-compatible
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3946
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/date_core.c5
1 files changed, 4 insertions, 1 deletions
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(">=");