Skip a redundant check for the rb_obj_hash case

Also, refactor the cfunc struct to use a new rb_cfunc_t.
This commit is contained in:
Takashi Kokubun 2024-03-01 15:01:20 -08:00
parent 5a3ae06a09
commit 61fbd29e14
2 changed files with 5 additions and 4 deletions

View file

@ -136,8 +136,9 @@ typedef struct rb_method_iseq_struct {
rb_cref_t * cref; /*!< class reference, should be marked */
} rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
typedef VALUE (*rb_cfunc_t)(ANYARGS);
typedef struct rb_method_cfunc_struct {
VALUE (*func)(ANYARGS);
rb_cfunc_t func;
VALUE (*invoker)(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS));
int argc;
} rb_method_cfunc_t;