mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
20b9002214
Move conditional mrb_define_method_id() calls into ROM entry arrays using #ifdef guards. With linear search, sizeof in MRB_MT_ROM_TAB() adjusts automatically after preprocessing. Cross-class ROM tables (methods a gem defines on a class it does not own) are reverted to mrb_define_method_id(). Multiple gems should not add ROM table layers to the same class; each layer costs a 16-byte mrb_mt_tbl struct in RAM and deepens the lookup chain. Use mrb_define_method_id() for cross-class methods. Co-authored-by: Claude <noreply@anthropic.com>