aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2022-03-25 22:04:26 +0000
committerPeter Zhu <peter@peterzhu.ca>2022-03-31 14:39:59 -0400
commitbb037f6d8639b7d36ef263ca24d4117d725e71ef (patch)
tree19e0c1901427fe04969a0f694fec34df9b38807c /gc.c
parentf380a255200aaa5c5838e7bef5ed19a7569b8c12 (diff)
downloadruby-bb037f6d8639b7d36ef263ca24d4117d725e71ef.tar.gz
Remove hard-coded swept slots threshold
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 9f5bc3736a..d620b66676 100644
--- a/gc.c
+++ b/gc.c
@@ -1116,6 +1116,9 @@ total_freed_pages(rb_objspace_t *objspace)
#else
#define will_be_incremental_marking(objspace) FALSE
#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))
#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 {
heap_add_freepage(heap, sweep_page);
swept_slots += free_slots;
- if (swept_slots > 2048) {
+ if (swept_slots > GC_INCREMENTAL_SWEEP_SLOT_COUNT) {
break;
}
}