diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-18 21:35:40 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-18 21:35:40 +0000 |
| commit | 81ed2d3c4aa19c03a6e2d644c853e5977fb53cc8 (patch) | |
| tree | 7895f84150f3d96638f650f91f9ae62d7f2c1f05 | |
| parent | 5a70af1d59b85c4987330b5ff8e3ef1cbb6e5668 (diff) | |
* gc.c (gc_stress_set): add special option of GC.stress.
`GC.stress=(flag)' accepts integer to control behavior of GC.
See code for details. Of course, this feature is only for MRI.
You can debug RGenGC (WB) using `GC.stress = 1'.
Using this option, do minor marking at all possible places.
GC::STRESS_MINOR_MARK = 1 and GC::STRESS_LAZY_SWEEP = 2
seem good to add.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 12 | ||||
| -rw-r--r-- | gc.c | 9 |
2 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,15 @@ +Wed Jun 19 06:31:08 2013 Koichi Sasada <ko1@atdot.net> + + * gc.c (gc_stress_set): add special option of GC.stress. + `GC.stress=(flag)' accepts integer to control behavior of GC. + See code for details. Of course, this feature is only for MRI. + + You can debug RGenGC (WB) using `GC.stress = 1'. + Using this option, do minor marking at all possible places. + + GC::STRESS_MINOR_MARK = 1 and GC::STRESS_LAZY_SWEEP = 2 + seem good to add. + Wed Jun 19 06:29:31 2013 Koichi Sasada <ko1@atdot.net> * vm.c (kwmerge_i): add WB. @@ -3833,6 +3833,13 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep if (ruby_gc_stress && !ruby_disable_gc_stress) { minor_gc = FALSE; immediate_sweep = TRUE; + + if (FIXNUM_P(ruby_gc_stress)) { + int flag = ruby_gc_stress; + + if (flag & 0x01) minor_gc = TRUE; + if (flag & 0x02) immediate_sweep = FALSE; + } } else { if (full_mark) { @@ -4171,7 +4178,7 @@ gc_stress_set(VALUE self, VALUE flag) { rb_objspace_t *objspace = &rb_objspace; rb_secure(2); - ruby_gc_stress = RTEST(flag); + ruby_gc_stress = FIXNUM_P(flag) ? flag : (RTEST(flag) ? Qtrue : Qfalse); return flag; } |
