From 4307461e58fbb871a2224acac9ecec8cf3ba4400 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 21 Mar 2026 14:15:05 +0900 Subject: [PATCH] gc.c: add symbol_count and dynamic_symbol_count to GC.stat Co-authored-by: Claude --- src/gc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gc.c b/src/gc.c index 4f203b92b..309a5c6e8 100644 --- a/src/gc.c +++ b/src/gc.c @@ -1812,6 +1812,8 @@ gc_stat(mrb_state *mrb, mrb_value self) mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "step_limit")), mrb_int_value(mrb, (mrb_int)gc->step_limit)); mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "malloc_increase")), mrb_int_value(mrb, (mrb_int)gc->malloc_increase)); mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "malloc_threshold")), mrb_int_value(mrb, (mrb_int)gc->malloc_threshold)); + mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "symbol_count")), mrb_int_value(mrb, (mrb_int)(MRB_PRESYM_MAX + mrb->symidx))); + mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "dynamic_symbol_count")), mrb_int_value(mrb, (mrb_int)mrb->dynamic_sym_count)); #ifdef MRB_GC_STATS mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_lit(mrb, "total")), mrb_int_value(mrb, (mrb_int)gc->gc_total_count));