FWIW, `StringValueCStr()` already exists and checks for no `\0` bytes and implies a terminating `\0`. It still seems too risky to change `RSTRING_PTR()` to not terminate though. FWIW, TruffleRuby already has lazy substrings and alway...Eregon (Benoit Daloze)
mame (Yusuke Endoh) wrote in #note-9: > When new syntax is introduced to the Ruby master branch, the built-in `prism.c` is updated immediately. In this scenario, if we attempt to retrieve `#ast` using the node definitions from a release...Eregon (Benoit Daloze)
Right, I will make a proposal for `Ruby::SourceLocation`/`Ruby::CodeLocation` or so. I hope it can be approved quickly without taking more time.Eregon (Benoit Daloze)
Eregon (Benoit Daloze) wrote in #note-5: > also considering there is no safeguard to avoid writing to `DATA_PTR` One idea to address this (but not the other 2 concerns) would be to raise on `DATA_PTR()` for `RUBY_TYPED_EMBEDDABLE`, a...Eregon (Benoit Daloze)
One tricky aspect about `RUBY_TYPED_EMBEDDABLE` is if in the `struct` there is a pointer to inside that `struct` then those pointers will become invalid when the object is moved. Is there a way to handle that correctly to update such poi...Eregon (Benoit Daloze)
I'm aware what I propose doesn't solve `Can't support objects of variable width`, i.e. the case for `Thread::Backtrace`. But AFAIK variable width is only available for core classes (not as public API), and `Thread::Backtrace` is core too...Eregon (Benoit Daloze)
Going further, `Class#safe_initialization` instead of redefining these 3 methods could just set a new `internal_alloc_func` field in RClass (only used by new/dup/clone and can never be read by anything else) + rb_undef_alloc_func(). And...Eregon (Benoit Daloze)
Thinking more about this I think there should be a protocol or an easy way to avoid the allocated-but-uninitialized state completely, which is problematic for classes defined in C but also in Ruby (though Ruby-defined classes will typica...Eregon (Benoit Daloze)