ParserSession reads the source string's backing byte[] directly, but the string itself was never marked as shared. A decimal_class callback that calls source.tr! could then rewrite the bytes the parser is still reading. The existing tes...sampokuokkanen (Sampo Kuokkanen)
Kernel#warn is private, but the methods defined by the polyfill were public, so loading prism made warn a public method on every object. Code that relies on warn not being public, like a logger proxy that forwards it through method_missi...sampokuokkanen (Sampo Kuokkanen)
The DNS side has the same problem. Only `rsock_getaddrinfo` asks the scheduler's `address_resolve`, and the fast-fallback path resolves on its own threads, so the default `TCPSocket.new` never calls the hook. The `address_resolve` docs l...sampokuokkanen (Sampo Kuokkanen)
I opened https://github.com/ruby/ruby/pull/19548 for this. It makes IO#wait_priority emit a deprecation warning (shown when Warning[:deprecated] is enabled) pointing to IO#wait(IO::PRIORITY, timeout), and adds a NEWS entry. The war...sampokuokkanen (Sampo Kuokkanen)
In #18655, IO#wait_readable, IO#wait_writable, IO#wait_priority, and IO#wait were moved from io/wait into core. However, in #18655 note 11, Matz wrote: > After the discussion, we will drop wait_priority, but others are accepted. htt...sampokuokkanen (Sampo Kuokkanen)
rb_yield() calls GET_EC() on every element, which on arm64 is an out-of-line call to rb_current_ec() (RB_THREAD_CURRENT_EC_NOINLINE). Hoist it out of the loop and use rb_ec_yield(), as ff831eb057 does for Mutex#synchronize. benchmark/lo...sampokuokkanen (Sampo Kuokkanen)
Move `Symbol#empty?` from the C `sym_empty` into `symbol.rb`, implemented as `RBOOL(RSTRING_LEN(rb_sym2str(self)) == 0)`, mirroring the existing Symbol#to_s and #name leaf builtins. Also added an `annotate_builtin! ` in `zjit/src/cruby_...sampokuokkanen (Sampo Kuokkanen)
Get rid of the CFUNC overhead in String#ascii_only? and #valid_encoding?. Define them as leaf Primitive.cexpr! builtins in a new string.rb, following the pattern of numeric.rb. This makes them 1.2x-1.4x faster across the interpreter, YJ...sampokuokkanen (Sampo Kuokkanen)
Read the cached coderange directly (flags & MASK) instead of calling the builtin: ascii_only? is == 7BIT, valid_encoding? is != BROKEN, side-exit on UNKNOWN. Drops the call, ~20% faster on ZJIT.sampokuokkanen (Sampo Kuokkanen)
String#casecmp? folds both operands with a Unicode case fold, allocating two new strings, and compares the results. For ASCII-only strings, Unicode case folding is equivalent to ASCII case-insensitive comparison, so the operands can be c...sampokuokkanen (Sampo Kuokkanen)