mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
baff6e630a
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>