ruby-changes:66448
From: Peter <ko1@a...>
Date: Thu, 10 Jun 2021 03:16:57 +0900 (JST)
Subject: [ruby-changes:66448] 8a46b480a7 (master): Refactor gc_marks_start_heap to only configure heap
https://git.ruby-lang.org/ruby.git/commit/?id=8a46b480a7 From 8a46b480a719a419e1d596ce20740da020501003 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Wed, 9 Jun 2021 13:31:44 -0400 Subject: Refactor gc_marks_start_heap to only configure heap Move the non-heap related configurations to gc_marks_start. --- gc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gc.c b/gc.c index c3157db..f7bbe95 100644 --- a/gc.c +++ b/gc.c @@ -5536,6 +5536,19 @@ gc_sweep_start_heap(rb_objspace_t *objspace, rb_heap_t *heap) https://github.com/ruby/ruby/blob/trunk/gc.c#L5536 heap->free_pages = NULL; #if GC_ENABLE_INCREMENTAL_MARK heap->pooled_pages = NULL; +#endif +} + +#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 4 +__attribute__((noinline)) +#endif +static void +gc_sweep_start(rb_objspace_t *objspace) +{ + gc_mode_transition(objspace, gc_mode_sweeping); + gc_sweep_start_heap(objspace, heap_eden); + +#if GC_ENABLE_INCREMENTAL_MARK objspace->rincgc.pooled_slots = 0; #endif @@ -5570,16 +5583,6 @@ gc_sweep_start_heap(rb_objspace_t *objspace, rb_heap_t *heap) https://github.com/ruby/ruby/blob/trunk/gc.c#L5583 } } -#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 4 -__attribute__((noinline)) -#endif -static void -gc_sweep_start(rb_objspace_t *objspace) -{ - gc_mode_transition(objspace, gc_mode_sweeping); - gc_sweep_start_heap(objspace, heap_eden); -} - static void gc_sweep_finish(rb_objspace_t *objspace) { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/