mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c: extract mrb_obj_alloc_core() for internal allocation
split mrb_obj_alloc() into type-validation wrapper and allocation core (mrb_obj_alloc_core). internal callers (mrb_proc_new, mrb_env_new) use the core directly, skipping 15+ lines of type validation per allocation. most impactful for workloads with heavy Proc/Env allocation (lambda calculus, block-intensive code). Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -279,4 +279,7 @@ mrb_value mrb_bint_abs(mrb_state *mrb, mrb_value x);
|
||||
void mrb_task_mark_all(mrb_state *mrb);
|
||||
#endif
|
||||
|
||||
/* Internal object allocation without type validation (gc.c) */
|
||||
struct RBasic* mrb_obj_alloc_core(mrb_state*, enum mrb_vtype, struct RClass*);
|
||||
|
||||
#endif /* MRUBY_INTERNAL_H */
|
||||
|
||||
Reference in New Issue
Block a user