Commit Graph

6 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 8956c5abb5 mruby.h: include mruby/presym.h for all source files
Since presym is now mandatory, mruby.h includes presym.h so that
MRB_SYM() macros are available everywhere without explicit include.
Remove redundant #include <mruby/presym.h> from all source files.

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-09 16:50:58 +09:00
Yukihiro "Matz" Matsumoto 7fe5c2e260 gc.c: rename mrb_alloca() to mrb_temp_alloc() and fix memory leaks
rename mrb_alloca() to mrb_temp_alloc() for clearer naming - the new name
better describes its purpose as GC-managed temporary allocation. keep
mrb_alloca() as a macro alias for backward compatibility.

apply mrb_temp_alloc() to fix potential memory leaks in:
- mruby-strftime: if mrb_str_cat() raises, allocated buffers now cleaned by GC
- mruby-io File.readlink: if mrb_str_new() raises, buffer now cleaned by GC

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-08 08:23:51 +09:00
Yukihiro "Matz" Matsumoto 5b32cbf089 mruby-strftime: combine variable declaration with initialization 2025-10-26 19:16:12 +09:00
Yukihiro "Matz" Matsumoto fec629309f mruby-strftime: prevent crash on msvc with unsupported %- flag
add validation to detect gnu extension %- flag and raise argumenterror
on msvc instead of crashing. update test to use portable %m format.

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-19 07:33:45 +09:00
Yukihiro "Matz" Matsumoto c04fdf862b mruby-strftime: add readme documentation
add comprehensive readme covering usage, format specifiers,
features, and implementation details.

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 23:01:28 +09:00
Yukihiro "Matz" Matsumoto b31e22f0bc mruby-strftime: implement time#strftime method
add new mruby-strftime gem providing time#strftime for formatting
time objects using standard format specifiers.

implementation features:
- uses mrb_time_get_tm() api for accessing time components
- handles nul bytes in format strings correctly
- dynamic buffer allocation for variable-length output
- comprehensive test coverage including edge cases

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 20:05:08 +09:00