summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-09-18 17:20:01 -0700
committerJohn Hawthorn <john@hawthorn.email>2025-09-19 15:35:15 -0700
commit7c51ce5ff625c1295d48ff041b22cb4a9d75c9aa (patch)
treecdb8b434c342535467e1f91fa0590188a386f511
parente44bec9b92d7d6d7286f57637df6e785b12fafb1 (diff)
Mark list as frozen and shareable
-rw-r--r--encoding.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/encoding.c b/encoding.c
index bda40eb043..e2c061480e 100644
--- a/encoding.c
+++ b/encoding.c
@@ -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);
}
}