ruby-changes:63410
From: Koichi <ko1@a...>
Date: Thu, 22 Oct 2020 00:07:00 +0900 (JST)
Subject: [ruby-changes:63410] 3a97d36157 (master): refactoring frozen_shareable_p
https://git.ruby-lang.org/ruby.git/commit/?id=3a97d36157 From 3a97d361576d1cc198047d502c5165aa37b7f86e Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Wed, 21 Oct 2020 23:57:44 +0900 Subject: refactoring frozen_shareable_p diff --git a/ractor.c b/ractor.c index 93a1fc5..2cf34cb 100644 --- a/ractor.c +++ b/ractor.c @@ -2065,18 +2065,14 @@ rb_obj_traverse(VALUE obj, https://github.com/ruby/ruby/blob/trunk/ractor.c#L2065 static int frozen_shareable_p(VALUE obj) { - switch (BUILTIN_TYPE(obj)) { - case T_DATA: - if (RTYPEDDATA_P(obj)) { - const rb_data_type_t *type = RTYPEDDATA_TYPE(obj); - if (type->flags & RUBY_TYPED_FROZEN_SHAREABLE) { - return true; - } - } - return false; - default: + if (!RB_TYPE_P(obj, T_DATA) || + (RTYPEDDATA_P(obj) && + RTYPEDDATA_TYPE(obj)->flags & RUBY_TYPED_FROZEN_SHAREABLE)) { return true; } + else { + return false; + } } static int -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/