summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2021-06-09 13:31:44 -0400
committerPeter Zhu <peter@peterzhu.ca>2021-06-09 14:16:39 -0400
commit8a46b480a719a419e1d596ce20740da020501003 (patch)
tree0b35db3ceb1d444c2aaad70e8e518aa1e0a0eaba
parentfa340dd9f1ce410360474ca7b07d0af8968599c7 (diff)
Refactor gc_marks_start_heap to only configure heap
Move the non-heap related configurations to gc_marks_start.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4560
-rw-r--r--gc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gc.c b/gc.c
index c3157dbe2c..f7bbe95b19 100644
--- a/gc.c
+++ b/gc.c
@@ -5536,6 +5536,19 @@ gc_sweep_start_heap(rb_objspace_t *objspace, rb_heap_t *heap)
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)
}
}
-#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)
{