Regarding the name in C API it could be `rb_class_safe_initialization()` to match `Class#safe_initialization` or maybe more intuitive `rb_define_internal_alloc_func()` or so (which would do both `rb_define_alloc_func()` + set it as inter...Eregon (Benoit Daloze)
Applied in changeset commit:git|cb03bf43eb2339e1d81b20a2dd9783b83660007c. ---------- Freeze all instances of Regexp, except subclass instances * Instances of a subclass of Regexp are not frozen for compatibility. * [Feature #8948] * Us...Eregon (Benoit Daloze)
* Instances of a subclass of Regexp are not frozen for compatibility. * [Feature #8948] * Use a less confusing example in test_regexp2, the ivar was named @encoding but had no effect on Regexp#encoding.Eregon (Benoit Daloze)
From the discussion at the dev meeting https://github.com/ruby/dev-meeting-log/blob/master/2026/DevMeeting-2026-01-14.md#feature-8948-frozen-regex-eregon > matz: try freezing Regexp instances, but no subclasses, and revisit it to check c...Eregon (Benoit Daloze)
PR implementing that idea and applying it for MatchData and Regexp, removing many checks which are no longer necessary: https://github.com/ruby/ruby/pull/16528 Instead of using 2 fields it's using the existing `allocator` field + a b...Eregon (Benoit Daloze)
A common issue when defining a class is to handle allocated-but-uninitialized objects. For example: ```ruby obj = MyClass.allocate obj.some_method ``` This can easily segfault for classes defined in C and raise an unclear excepti...Eregon (Benoit Daloze)
* [Feature #21962] Add deep_freeze for recursive freezing (eregon) * A revised proposal that aims to address the previous discussion. * It follows the behavior of `Ractor.make_shareable`, and is also consistent with `IceNine.deep_fre...Eregon (Benoit Daloze)
I made a revised proposal that aims to address the previous discussion: #21962. It follows the behavior of `Ractor.make_shareable`, and is also consistent with `IceNine.deep_freeze`, so the semantics are already well understood and ha...Eregon (Benoit Daloze)
### Motivation It is common to want some data structure to be immutable, e.g. to ensure it doesn't get mutated by multiple threads. See the first section of #21665 for a more detailed motivation, the summary is there is long-standing...Eregon (Benoit Daloze)
akr (Akira Tanaka) wrote in #note-10: > The separation of allocation and initialization is essential to marshal cyclically referenced objects. Thank you for that, I didn't think about it. That would then be only a small tweak for my...Eregon (Benoit Daloze)