Files
Yukihiro "Matz" Matsumoto baff6e630a mruby-io: add IO#putc and Kernel#putc for efficient character output
IO#putc writes a single character without intermediate string allocation.
- Integer argument: writes byte value (mod 256)
- String argument: writes first character (UTF-8 aware when MRB_UTF8_STRING)
- Returns the argument (IO#putc) or nil (Kernel#putc, matching CRuby)

This provides ~44% memory reduction for character-by-character output
compared to printf "%c" or print ch.chr approaches.

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-18 16:27:27 +09:00
..