aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 40212204a3..32d6079758 100644
--- a/gc.c
+++ b/gc.c
@@ -460,6 +460,7 @@ ruby_memerror(void)
else {
/* no ruby thread */
fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ if (UNLIKELY(TRACE_RAISE_ENABLED())) FIRE_RAISE_FATAL();
exit(EXIT_FAILURE);
}
}
@@ -472,6 +473,7 @@ rb_memerror(void)
if (!nomem_error ||
(rb_thread_raised_p(th, RAISED_NOMEMORY) && rb_safe_level() < 4)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ if (UNLIKELY(TRACE_RAISE_ENABLED())) FIRE_RAISE_FATAL();
exit(EXIT_FAILURE);
}
if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
@@ -604,6 +606,7 @@ negative_size_allocation_error(const char *msg)
}
else {
fprintf(stderr, "[FATAL] %s\n", msg);
+ if (UNLIKELY(TRACE_RAISE_ENABLED())) FIRE_RAISE_FATAL();
exit(EXIT_FAILURE);
}
}
@@ -629,6 +632,7 @@ garbage_collect_with_gvl(rb_objspace_t *objspace)
else {
/* no ruby thread */
fprintf(stderr, "[FATAL] failed to allocate memory\n");
+ if (UNLIKELY(TRACE_RAISE_ENABLED())) FIRE_RAISE_FATAL();
exit(EXIT_FAILURE);
}
}
@@ -1973,6 +1977,8 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
break;
}
+ if (TRACE_OBJECT_FREE_ENABLED()) FIRE_OBJECT_FREE(rb_obj_id(obj));
+
if (FL_TEST(obj, FL_EXIVAR)) {
rb_free_generic_ivar((VALUE)obj);
FL_UNSET(obj, FL_EXIVAR);
@@ -2153,6 +2159,7 @@ garbage_collect(rb_objspace_t *objspace)
during_gc++;
objspace->count++;
+ if (TRACE_GC_BEGIN_ENABLED()) FIRE_GC_BEGIN();
GC_PROF_TIMER_START;
GC_PROF_MARK_TIMER_START;
SET_STACK_END;
@@ -2201,6 +2208,7 @@ garbage_collect(rb_objspace_t *objspace)
GC_PROF_SWEEP_TIMER_STOP;
GC_PROF_TIMER_STOP;
+ if (TRACE_GC_END_ENABLED()) FIRE_GC_END();
if (GC_NOTIFY) printf("end garbage_collect()\n");
return TRUE;
}