summaryrefslogtreecommitdiffhomepage
path: root/src/gc.c
diff options
context:
space:
mode:
authorfleuria <[email protected]>2013-07-23 17:00:55 +0800
committerfleuria <[email protected]>2013-07-23 17:04:54 +0800
commit9bce2eb8b399a27ffdd0073606ca3cb14268348f (patch)
tree88d20671244457ce5a9d9e55688d5b950da2adee /src/gc.c
parent29a3f8b8e3826551daedbc4802a12ae2411a0351 (diff)
downloadmruby-9bce2eb8b399a27ffdd0073606ca3cb14268348f.tar.gz
mruby-9bce2eb8b399a27ffdd0073606ca3cb14268348f.zip
gc: add comments for Generational Mode
Diffstat (limited to 'src/gc.c')
-rw-r--r--src/gc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gc.c b/src/gc.c
index 05577f9c7..cfe48df68 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -66,7 +66,7 @@
For details, see the comments for each function.
- = Write Barrier
+ == Write Barrier
mruby implementer, C extension library writer must write a write
barrier when writing a pointer to an object on object's field.
@@ -75,6 +75,20 @@
* mrb_field_write_barrier
* mrb_write_barrier
+ == Generational Mode
+
+ mruby's GC offers an Generational Mode while re-using the tri-color GC
+ infrastructure. It will treat the Black objects as Old objects after each
+ sweep phase, instead of paint them to White. The key idea are still same as
+ the traditional generational GC:
+
+ * Minor GC - just traverse the Young objects (Gray objects) in the mark
+ phase, then only sweep the newly created objects, and leave
+ the Old objects live.
+
+ * Major GC - same as a full round of regular GC.
+
+
For details, see the comments for each function.
*/