Skip to content

Commit b33baf1

Browse files
committed
Remove magic 7/8 number
1 parent 57dc2fa commit b33baf1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

gc/default/default.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5507,8 +5507,8 @@ gc_sweep_finish_heap(rb_objspace_t *objspace, rb_heap_t *heap)
55075507
heap_allocatable_bytes_expand(objspace, heap, swept_slots, heap->total_slots, heap->slot_size);
55085508
}
55095509
}
5510-
else if (swept_slots < min_free_slots * 7 / 8 &&
5511-
objspace->heap_pages.allocatable_bytes < (min_free_slots * 7 / 8 - swept_slots) * heap->slot_size) {
5510+
else if (swept_slots < min_free_slots &&
5511+
objspace->heap_pages.allocatable_bytes < (min_free_slots - swept_slots) * heap->slot_size) {
55125512
gc_needs_major_flags |= GPR_FLAG_MAJOR_BY_NOFREE;
55135513
heap->force_major_gc_count++;
55145514
}
@@ -7543,7 +7543,7 @@ gc_marks_finish(rb_objspace_t *objspace)
75437543
}
75447544

75457545
if (objspace->heap_pages.allocatable_bytes == 0 && sweep_slots < min_free_slots) {
7546-
if (!full_marking && sweep_slots < min_free_slots * 7 / 8) {
7546+
if (!full_marking && sweep_slots < min_free_slots) {
75477547
if (objspace->profile.count - objspace->rgengc.last_major_gc < RVALUE_OLD_AGE) {
75487548
full_marking = TRUE;
75497549
}

0 commit comments

Comments
 (0)