Skip to content

Commit bbe44b9

Browse files
committed
Enable sweep thread when calling GC.start
1 parent 7290630 commit bbe44b9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

gc/default/default.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4869,10 +4869,7 @@ gc_sweep_start(rb_objspace_t *objspace)
48694869
rb_gc_ractor_newobj_cache_foreach(gc_ractor_newobj_cache_clear, NULL);
48704870

48714871
psweep_debug(1, "[gc] gc_sweep_start\n");
4872-
if (!objspace->flags.during_compacting &&
4873-
(objspace->profile.latest_gc_info & GPR_FLAG_METHOD) == 0 &&
4874-
!(objspace->hook_events & RUBY_INTERNAL_EVENT_FREEOBJ)) {
4875-
4872+
if (!objspace->flags.during_compacting && !(objspace->hook_events & RUBY_INTERNAL_EVENT_FREEOBJ)) {
48764873
rbimpl_atomic_store(&objspace->use_background_sweep_thread, true, RBIMPL_ATOMIC_RELEASE);
48774874
psweep_debug(-1, "[gc] gc_sweep_start: requesting sweep thread\n");
48784875
sweep_lock_lock(&objspace->sweep_lock);
@@ -8428,7 +8425,6 @@ rb_gc_impl_start(void *objspace_ptr, bool full_mark, bool immediate_mark, bool i
84288425
sweep_lock_lock(&objspace->sweep_lock);
84298426
{
84308427
GC_ASSERT(!objspace->sweep_thread_sweeping);
8431-
GC_ASSERT(!objspace->sweep_thread_sweep_requested);
84328428
for (int j = 0; j < HEAP_COUNT; j++) {
84338429
rb_heap_t *heap = &heaps[j];
84348430
GC_ASSERT(!heap->swept_pages);

0 commit comments

Comments
 (0)