mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c: add optional GC statistics counters
Add gc_total_count, minor_gc_count, major_gc_count (uint32_t) to mrb_gc, guarded by MRB_GC_STATS. Zero cost when disabled. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,12 @@ typedef struct mrb_gc {
|
||||
int arena_capa; /* size of protection array */
|
||||
#endif
|
||||
int arena_idx;
|
||||
|
||||
#ifdef MRB_GC_STATS
|
||||
uint32_t gc_total_count; /* total GC invocations */
|
||||
uint32_t minor_gc_count; /* minor GC count */
|
||||
uint32_t major_gc_count; /* major GC count */
|
||||
#endif
|
||||
} mrb_gc;
|
||||
|
||||
MRB_API mrb_bool mrb_object_dead_p(mrb_state *mrb, struct RBasic *object);
|
||||
|
||||
Reference in New Issue
Block a user