dearblue · GitHub

The purpose is to remove the `mid` field from the `mrb_cache_entry` structure.
The resulting RAM requirement for the method cache is reduced from 5 words per entry to 4 words per entry for 32-bit CPUs.
The relevant changes are as follows:
  - Removed `MRB_USE_METHOD_T_STRUCT`.
    The `mrb_method_t` type is now always defined as a structure.
  - Include method IDs in `mrb_method_t`
    Change the `flags` member to `uint32_t`.
    The bitstring structure should be the same as the keys of the `mt` table in `class.c`.
I believe the impact on API compatibility with previous versions is minimal.

@dearblue

@matz

matz added a commit that referenced this pull request

Apr 2, 2024
- MRB_METHOD_CFUNC_P: reduce ternary; use logical-or instead
- MRB_METHOD_CFUNC: assume MRB_METHOD_CFUNC_P check before call

Read the original on github.com ↗