[前][次][番号順一覧][スレッド一覧]

ruby-changes:71582

From: Matt <ko1@a...>
Date: Fri, 1 Apr 2022 03:40:15 +0900 (JST)
Subject: [ruby-changes:71582] bb037f6d86 (master): Remove hard-coded swept slots threshold

https://git.ruby-lang.org/ruby.git/commit/?id=bb037f6d86

From bb037f6d8639b7d36ef263ca24d4117d725e71ef Mon Sep 17 00:00:00 2001
From: Matt Valentine-House <matt@e...>
Date: Fri, 25 Mar 2022 22:04:26 +0000
Subject: Remove hard-coded swept slots threshold

---
 gc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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) https://github.com/ruby/ruby/blob/trunk/gc.c#L1116
 #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 https://github.com/ruby/ruby/blob/trunk/gc.c#L5850
 	    else {
                 heap_add_freepage(heap, sweep_page);
                 swept_slots += free_slots;
-                if (swept_slots > 2048) {
+                if (swept_slots > GC_INCREMENTAL_SWEEP_SLOT_COUNT) {
                     break;
                 }
 	    }
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]