Remove hard-coded swept slots threshold
This commit is contained in:
parent
f380a25520
commit
bb037f6d86
Notes:
git
2022-04-01 03:40:23 +09:00
5
gc.c
5
gc.c
@ -1116,6 +1116,9 @@ total_freed_pages(rb_objspace_t *objspace)
|
|||||||
#else
|
#else
|
||||||
#define will_be_incremental_marking(objspace) FALSE
|
#define will_be_incremental_marking(objspace) FALSE
|
||||||
#endif
|
#endif
|
||||||
|
#if GC_ENABLE_INCREMENTAL_MARK
|
||||||
|
#define GC_INCREMENTAL_SWEEP_SLOT_COUNT 2048
|
||||||
|
#endif
|
||||||
#define is_lazy_sweeping(objspace) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(objspace))
|
#define is_lazy_sweeping(objspace) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(objspace))
|
||||||
|
|
||||||
#if SIZEOF_LONG == SIZEOF_VOIDP
|
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||||
@ -5847,7 +5850,7 @@ gc_sweep_step(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *hea
|
|||||||
else {
|
else {
|
||||||
heap_add_freepage(heap, sweep_page);
|
heap_add_freepage(heap, sweep_page);
|
||||||
swept_slots += free_slots;
|
swept_slots += free_slots;
|
||||||
if (swept_slots > 2048) {
|
if (swept_slots > GC_INCREMENTAL_SWEEP_SLOT_COUNT) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user