ioquatix (Samuel Williams) wrote in #note-10: > As per my design, a buffer that is frozen does not need to update or touch `locked_count` (in fact, only a buffer with `locked_count == 0` can be frozen). Once frozen, all operations (that...himura467 (Akito Shitara)
ioquatix (Samuel Williams) wrote in #note-6: > `freeze` is for "safe to share this Ruby object" and `readonly` means the backing buffer cannot be modified by this view. As far as I know, there is currently no API to make an existing ...himura467 (Akito Shitara)
ioquatix (Samuel Williams) wrote in #note-6: > Therefore, I'm against a frozen buffer meaning underlying memory cannot be modified. If Matz agrees, I don't have a strong opinion on how freeze should be interpreted. However, under thi...himura467 (Akito Shitara)
ioquatix (Samuel Williams) wrote in #note-6: > For the purpose of sharing `IO::Buffer`, `freeze`ing this state is sufficient. Even on a frozen buffer, `#locked` updates `lock_count` with a non-atomic read-modify-write, so two Ractors...himura467 (Akito Shitara)
Using autoconf 2.73 with `AC_CHECK_DECL` as you suggested would fix it. However, requiring 2.73 seems difficult for now, since the release tarballs are generated by 2.71, and Ubuntu 24.04/26.04 ship 2.71/2.72. So I think a runtime ch...himura467 (Akito Shitara)
Eregon (Benoit Daloze) wrote in #note-22: > Unless I'm missing something, I don't think `IO::Buffer#slice_string` can work without copying: it would reference some `char*`, but the `IO::Buffer` might reallocate (e.g. if appended to), an...himura467 (Akito Shitara)
Writing to the contents of a frozen `IO::Buffer` does not raise `FrozenError`: ```ruby buffer = IO::Buffer.new(8) buffer.freeze buffer.set_string("x", 0) # no FrozenError buffer.get_string # => "x\x00\x00\x00\x00\x00\x00...himura467 (Akito Shitara)
Thanks for taking this. Matz asked for out-of-range `offset` and `length` to return `nil` rather than raise. Assuming you have no objection to that direction, there are a few points I would like to think through. The first is wheth...himura467 (Akito Shitara)
* [Feature #22056] Zero-Copy String Constructor Backed by Arbitrary Ruby Object (himura467) * A C API creating a String that references memory owned by another Ruby object instead of copying it. * It was blocked on the `RSTRING_PTR()...himura467 (Akito Shitara)