Skip to content

Commit 316ece5

Browse files
committed
Fix issue with gc_rest() and MISMATCH debug
1 parent 8f857aa commit 316ece5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gc/default/default.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5012,7 +5012,9 @@ gc_sweep_finish(rb_objspace_t *objspace)
50125012
rbimpl_atomic_store(&objspace->use_background_sweep_thread, false, RBIMPL_ATOMIC_RELEASE);
50135013

50145014
#if RUBY_DEBUG
5015-
if (!objspace->flags.was_compacting) {
5015+
// When calling GC.start, if in the middle of a non-full mark it will be set as full mark in gc_rest() so the numbers
5016+
// will be off.
5017+
if (!objspace->flags.was_compacting && !objspace->sweep_rest) {
50165018
if (objspace->will_be_swept_slots != objspace->have_swept_slots) {
50175019
fprintf(stderr, "Expecting to free %lu slots, freed %lu slots (major:%d)\n", objspace->will_be_swept_slots, objspace->have_swept_slots, is_full_marking(objspace));
50185020
for (int i = 0; i < HEAP_COUNT; i++) {

0 commit comments

Comments
 (0)