freeze Encoding objects
Encoding objects can be accessed in multi-ractors and there is no state to mutate. So we can mark it as frozen and shareable. [Bug #17188]
This commit is contained in:
parent
11c2f0f36c
commit
102c2ba65f
Notes:
git
2020-10-14 14:02:33 +09:00
@ -122,7 +122,10 @@ rb_data_is_encoding(VALUE obj)
|
||||
static VALUE
|
||||
enc_new(rb_encoding *encoding)
|
||||
{
|
||||
return TypedData_Wrap_Struct(rb_cEncoding, &encoding_data_type, (void *)encoding);
|
||||
VALUE enc = TypedData_Wrap_Struct(rb_cEncoding, &encoding_data_type, (void *)encoding);
|
||||
rb_obj_freeze(enc);
|
||||
FL_SET_RAW(enc, RUBY_FL_SHAREABLE);
|
||||
return enc;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user