Skip to content

Commit 1c29fbe

Browse files
committed
GC_DEBUG_STRESS_TO_CLASS should only be for debug
I believe this was accidentally left in as part of 2beb379
1 parent 5828872 commit 1c29fbe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gc/default/default.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ int ruby_rgengc_debug;
316316
#endif
317317

318318
#ifndef GC_DEBUG_STRESS_TO_CLASS
319-
# define GC_DEBUG_STRESS_TO_CLASS 1
319+
# define GC_DEBUG_STRESS_TO_CLASS RUBY_DEBUG
320320
#endif
321321

322322
typedef enum {
@@ -9428,6 +9428,7 @@ rb_gc_impl_after_fork(void *objspace_ptr, rb_pid_t pid)
94289428

94299429
VALUE rb_ident_hash_new_with_size(st_index_t size);
94309430

9431+
#if GC_DEBUG_STRESS_TO_CLASS
94319432
/*
94329433
* call-seq:
94339434
* GC.add_stress_to_class(class[, ...])
@@ -9477,6 +9478,7 @@ rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self)
94779478

94789479
return Qnil;
94799480
}
9481+
#endif
94809482

94819483
void *
94829484
rb_gc_impl_objspace_alloc(void)
@@ -9582,10 +9584,10 @@ rb_gc_impl_init(void)
95829584
rb_define_singleton_method(rb_mGC, "verify_compaction_references", rb_f_notimplement, -1);
95839585
}
95849586

9585-
if (GC_DEBUG_STRESS_TO_CLASS) {
9586-
rb_define_singleton_method(rb_mGC, "add_stress_to_class", rb_gcdebug_add_stress_to_class, -1);
9587-
rb_define_singleton_method(rb_mGC, "remove_stress_to_class", rb_gcdebug_remove_stress_to_class, -1);
9588-
}
9587+
#if GC_DEBUG_STRESS_TO_CLASS
9588+
rb_define_singleton_method(rb_mGC, "add_stress_to_class", rb_gcdebug_add_stress_to_class, -1);
9589+
rb_define_singleton_method(rb_mGC, "remove_stress_to_class", rb_gcdebug_remove_stress_to_class, -1);
9590+
#endif
95899591

95909592
/* internal methods */
95919593
rb_define_singleton_method(rb_mGC, "verify_internal_consistency", gc_verify_internal_consistency_m, 0);

0 commit comments

Comments
 (0)