General

Profile

himura467 (Akito Shitara)

  • Login: himura467
  • Registered on: 05/05/2026
  • Last sign in: 08/24/2026

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 2 5 7

Activity

08/24/2026

05:38 PM Ruby Feature #22231: Add `IO::Buffer#index`
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)

08/23/2026

05:57 AM Ruby Misc #22249: DevMeeting-2026-09-10
* [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)

08/22/2026

10:21 PM Ruby Bug #22195: IO::Buffer read after free silently returns empty data instead of raising
I think one thing here still needs fixing.
`IO::Buffer.new(0)` and `IO::Buffer.new(0).slice(0, 0)` are both `{NULL, 0}`, but they do not behave the same. On master (4.1.0dev, 37325e9f7a):
```ruby
IO::Buffer.new(0).get_string ...
himura467 (Akito Shitara)
10:07 PM Ruby Bug #22195: IO::Buffer read after free silently returns empty data instead of raising
Thanks for the review.
I filed this because the rdoc for `#free` says that access after free raises, while it does not, so either the implementation or the documentation had to be wrong:
* "After the buffer is freed, no further ope...
himura467 (Akito Shitara)
07:23 PM Ruby Feature #22056: Add zero-copy String constructor backed by an arbitrary Ruby object
For the `IO::Buffer#get_string` use case in the description, I would propose a new method rather than changing `get_string`:
```ruby
IO::Buffer#slice_string([offset, [length, [encoding]]]) -> string
```
built on `rb_enc_str_new_e...
himura467 (Akito Shitara)

08/21/2026

02:30 PM Ruby Feature #22056: Add zero-copy String constructor backed by an arbitrary Ruby object
In #note-19 the blocker here was the `RSTRING_PTR()` NUL-termination invariant, to be settled in #19315 first. I have just reported there that `SHARABLE_MIDDLE_SUBSTRING` is neutral on ruby-bench now that [Feature #22186] has landed, so ... himura467 (Akito Shitara)
02:26 PM Ruby Feature #19315: Lazy substrings in CRuby
[Feature #22186] landed as commit:https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/a9017ccc1346f620ff1f1b4340fffdd6b4069f96, so per Matz's request in #22186#note-16 I am revisiting this.
ruby-bench with `SHARAB...
himura467 (Akito Shitara)

08/08/2026

08:58 AM Ruby Bug #22234 (Closed): IO::Buffer#resize(0) copies uninitialized memory into the buffer
## Reproduction
```ruby
buffer = IO::Buffer.new(64)
slice = buffer.slice(0, 8)
slice.resize(0)
slice.size # => an arbitrary size or a SEGV
```
The outcome depends on what the stack happens to hold. Reading `slice.inspect` inst...
himura467 (Akito Shitara)

08/07/2026

02:38 PM Ruby Feature #22186 (Closed): Increase the embeddable size limit for substrings created by `str_subseq()`
Applied in changeset commit:git|a9017ccc1346f620ff1f1b4340fffdd6b4069f96.
----------
str_subseq: copy sharable substrings up to a 256 byte slot
Previously the embedded path allocated a full-size embedded string via str_alloc_heap plus ...
himura467 (Akito Shitara)
02:37 PM Ruby Revision a9017ccc (git): str_subseq: copy sharable substrings up to a 256 byte slot
Previously the embedded path allocated a full-size embedded string via str_alloc_heap plus STR_SET_EMBED, which capped the copy at the default struct RString slot whatever the substring length. Size the allocation to the substring with s... himura467 (Akito Shitara)

Also available in: Atom