summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-15 14:31:31 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commit228118482e4df04e42b64bca09f7bf2306c2314f (patch)
tree97493c730c3a35a433a0f1627f210e0903acbdd7 /gc.c
parente9cb092b2d4ce21dbf124ea614adaa13e12178f0 (diff)
gc_marks_finish: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index 4744d211e9..05b8fb3b45 100644
--- a/gc.c
+++ b/gc.c
@@ -6459,15 +6459,15 @@ gc_marks_finish(rb_objspace_t *objspace)
if (objspace->profile.count - objspace->rgengc.last_major_gc < RVALUE_OLD_AGE) {
full_marking = TRUE;
/* do not update last_major_gc, because full marking is not done. */
- goto increment;
+ /* goto increment; */
}
else {
gc_report(1, objspace, "gc_marks_finish: next is full GC!!)\n");
objspace->rgengc.need_major_gc |= GPR_FLAG_MAJOR_BY_NOFREE;
}
}
- else {
- increment:
+ if (full_marking) {
+ /* increment: */
gc_report(1, objspace, "gc_marks_finish: heap_set_increment!!\n");
heap_set_increment(objspace, heap_extend_pages(objspace, sweep_slots, total_slots));
heap_increment(objspace, heap);