Mark list as frozen and shareable

This commit is contained in:
John Hawthorn 2025-09-18 17:20:01 -07:00
parent e44bec9b92
commit 7c51ce5ff6

View File

@ -152,6 +152,8 @@ enc_list_update(int index, rb_raw_encoding *encoding)
RBASIC_CLEAR_CLASS(new_list);
/* initialize encoding data */
rb_ary_store(new_list, index, enc_new(encoding));
rb_ary_freeze(new_list);
FL_SET_RAW(new_list, RUBY_FL_SHAREABLE);
RUBY_ATOMIC_VALUE_SET(rb_encoding_list, new_list);
}
}