summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorfleuria <[email protected]>2013-08-01 17:30:57 +0800
committerfleuria <[email protected]>2013-08-01 17:30:57 +0800
commitc1469a57a2639a3b76a8f4b031ae73f04990891c (patch)
tree20368bfa9996571516c33474e45bb96cc0a8f813
parentd16edc11ca9b4754a79f0fb4f481c3bd46077bac (diff)
downloadmruby-c1469a57a2639a3b76a8f4b031ae73f04990891c.tar.gz
mruby-c1469a57a2639a3b76a8f4b031ae73f04990891c.zip
add comment for clear_all_old()
-rw-r--r--src/gc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gc.c b/src/gc.c
index 8569cc085..8d0ad5500 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -941,11 +941,15 @@ clear_all_old(mrb_state *mrb)
incremental_gc_until(mrb, GC_STATE_NONE);
}
+ /* Sweep the dead objects, then reset all the live objects
+ * (including all the old objects, of course) to white. */
mrb->is_generational_gc_mode = FALSE;
prepare_incremental_sweep(mrb);
incremental_gc_until(mrb, GC_STATE_NONE);
- mrb->atomic_gray_list = mrb->gray_list = NULL;
mrb->is_generational_gc_mode = origin_mode;
+
+ /* The gray objects has already been painted as white */
+ mrb->atomic_gray_list = mrb->gray_list = NULL;
}
void