Skip to content

Commit 6538f6e

Browse files
committed
tests with --enable-parallel-sweep (on/off) and without now pass
1 parent 947383a commit 6538f6e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

gc/default/default.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,8 @@ typedef struct rb_objspace {
637637
bool background_sweep_abort;
638638
bool background_sweep_restart_heaps;
639639
unsigned int heaps_done_background_sweep;
640-
#endif
641-
642640
bool sweep_rest;
641+
#endif
643642

644643
struct {
645644
rb_atomic_t finalizing;
@@ -3609,8 +3608,8 @@ gc_abort(void *objspace_ptr)
36093608
objspace->sweeping_heap_count = 0;
36103609
for (int i = 0; i < HEAP_COUNT; i++) {
36113610
rb_heap_t *heap = &heaps[i];
3612-
#if USE_PARALLEL_SWEEP
36133611
heap->sweeping_page = NULL;
3612+
#if USE_PARALLEL_SWEEP
36143613
heap->swept_pages = NULL;
36153614
heap->pre_sweeping_page = NULL;
36163615
heap->is_finished_sweeping = false;
@@ -4360,7 +4359,7 @@ gc_sweep_page(rb_objspace_t *objspace, rb_heap_t *heap, struct gc_sweep_context
43604359
rbimpl_atomic_store(&sweep_page->before_sweep, 0, RBIMPL_ATOMIC_RELEASE);
43614360
objspace->sweep_stats.pages_swept_by_ruby_thread++;
43624361
#else
4363-
sweep_page->before_sweep = 1;
4362+
sweep_page->before_sweep = 0;
43644363
#endif
43654364
sweep_page->free_slots = 0;
43664365

@@ -5196,9 +5195,9 @@ static void
51965195
gc_sweep_finish(rb_objspace_t *objspace)
51975196
{
51985197
gc_report(1, objspace, "gc_sweep_finish\n");
5199-
psweep_debug(-1, "[gc] gc_sweep_finish\n");
52005198

52015199
#if USE_PARALLEL_SWEEP
5200+
psweep_debug(-1, "[gc] gc_sweep_finish\n");
52025201
rbimpl_atomic_store(&objspace->use_background_sweep_thread, false, RBIMPL_ATOMIC_RELEASE);
52035202
#endif
52045203

@@ -5452,7 +5451,7 @@ gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
54525451
return heap->free_pages != NULL;
54535452
}
54545453
#else
5455-
if (heap->sweeping_page == NULL) return heap->free_pages != NULL;
5454+
if (!heap->sweeping_page) return FALSE;
54565455
#endif
54575456

54585457
#if GC_ENABLE_LAZY_SWEEP
@@ -5610,8 +5609,8 @@ gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
56105609
if (!sweep_rest && use_sweep_thread) {
56115610
rbimpl_atomic_inc(&heap->foreground_sweep_steps, RBIMPL_ATOMIC_RELEASE); // signal sweep thread to move on
56125611
}
5613-
#endif
56145612
psweep_debug(0, "[gc] gc_sweep_step got to SWEEP_SLOT_COUNT, break\n");
5613+
#endif
56155614
break;
56165615
}
56175616
}

0 commit comments

Comments
 (0)