mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
load.c: consolidate irep allocation for .mrb loading
Pack pool/syms/reps arrays into a single calloc with the irep struct, reducing 4 allocations per irep to 1. Arrays are ordered by descending alignment (pool/reps/syms) to eliminate inter-array padding. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,7 @@ struct mrb_irep {
|
||||
#define MRB_ISEQ_NO_FREE 1
|
||||
#define MRB_IREP_NO_FREE 2
|
||||
#define MRB_IREP_STATIC (MRB_ISEQ_NO_FREE | MRB_IREP_NO_FREE)
|
||||
#define MRB_IREP_CONSOLIDATED 4 /* pool/syms/reps packed with irep struct */
|
||||
|
||||
MRB_API mrb_irep *mrb_add_irep(mrb_state *mrb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user