summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-08-09 18:11:16 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-08-09 18:11:16 +0900
commit3d3ca985b016afa7d07b59a067a661ce47b221ba (patch)
treedaf21a04532e9ff2594b3848a04c0f49af94b826
parent93d2cb0258a7df484073f2e50776e6a5767a73f7 (diff)
downloadmruby-3d3ca985b016afa7d07b59a067a661ce47b221ba.tar.gz
mruby-3d3ca985b016afa7d07b59a067a661ce47b221ba.zip
remove duplicated incremental_gc_until() in generational GC; #1449
-rw-r--r--src/gc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gc.c b/src/gc.c
index 3e3acfdfb..222fc0ce6 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -1007,16 +1007,15 @@ mrb_full_gc(mrb_state *mrb)
GC_INVOKE_TIME_REPORT("mrb_full_gc()");
GC_TIME_START;
- if (mrb->gc_state != GC_STATE_NONE) {
- /* finish half baked GC cycle */
- incremental_gc_until(mrb, GC_STATE_NONE);
- }
-
- /* clear all the old objects back to young */
if (is_generational(mrb)) {
+ /* clear all the old objects back to young */
clear_all_old(mrb);
mrb->gc_full = TRUE;
}
+ else if (mrb->gc_state != GC_STATE_NONE) {
+ /* finish half baked GC cycle */
+ incremental_gc_until(mrb, GC_STATE_NONE);
+ }
incremental_gc_until(mrb, GC_STATE_NONE);
mrb->gc_threshold = (mrb->gc_live_after_mark/100) * mrb->gc_interval_ratio;