Koichi Sasada <ko1 / atdot.net> wrote:
> On 2018/05/01 12:18, Eric Wong wrote:
> >>`gc_rest()` do all of rest steps.  Is it intentional?
> >
> >I thought about that myself.  I haven't measured impact much and
> >decided to have less code.
> 
> On worst case, it takes few seconds. We have "incremental" mechanism so we
> should use same incremental technique here too.

Oh sorry, I realize I was using the wrong gc.c functions :x
Something like:
```
--- a/gc.c
+++ b/gc.c
@@ -6533,8 +6533,12 @@ int
 rb_gc_step(const rb_execution_context_t *ec)
 {
     rb_objspace_t *objspace = rb_ec_vm_ptr(ec)->objspace;
-
-    gc_rest(objspace);
+    if (is_lazy_sweeping(&objspace->eden_heap)) {
+	gc_sweep_step(objspace, &objspace->eden_heap);
+    }
+    else if (is_incremental_marking(objspace)) {
+        /* FIXME TODO */
+    }
 
     return rb_gc_inprogress(ec);
 }

```
I haven't looked at incremental mark, yet :x

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>