aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debug_counter.h1
-rw-r--r--gc.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/debug_counter.h b/debug_counter.h
index b29d5ef560..3fcb562f65 100644
--- a/debug_counter.h
+++ b/debug_counter.h
@@ -119,6 +119,7 @@ RB_DEBUG_COUNTER(gc_major_nofree)
RB_DEBUG_COUNTER(gc_major_oldgen)
RB_DEBUG_COUNTER(gc_major_shady)
RB_DEBUG_COUNTER(gc_major_force)
+RB_DEBUG_COUNTER(gc_major_oldmalloc)
/* object allocation counts:
*
diff --git a/gc.c b/gc.c
index c4d12770b2..c3c4f4ea57 100644
--- a/gc.c
+++ b/gc.c
@@ -6538,11 +6538,15 @@ gc_start(rb_objspace_t *objspace, int reason)
#if USE_DEBUG_COUNTER
RB_DEBUG_COUNTER_INC(gc_count);
+
if (reason & GPR_FLAG_MAJOR_MASK) {
(void)RB_DEBUG_COUNTER_INC_IF(gc_major_nofree, reason & GPR_FLAG_MAJOR_BY_NOFREE);
(void)RB_DEBUG_COUNTER_INC_IF(gc_major_oldgen, reason & GPR_FLAG_MAJOR_BY_OLDGEN);
(void)RB_DEBUG_COUNTER_INC_IF(gc_major_shady, reason & GPR_FLAG_MAJOR_BY_SHADY);
(void)RB_DEBUG_COUNTER_INC_IF(gc_major_force, reason & GPR_FLAG_MAJOR_BY_FORCE);
+#if RGENGC_ESTIMATE_OLDMALLOC
+ (void)RB_DEBUG_COUNTER_INC_IF(gc_major_oldmalloc, reason & GPR_FLAG_MAJOR_BY_OLDMALLOC);
+#endif
}
else {
(void)RB_DEBUG_COUNTER_INC_IF(gc_minor_newobj, reason & GPR_FLAG_NEWOBJ);