ruby-changes:33879
From: ko1 <ko1@a...>
Date: Fri, 16 May 2014 17:41:12 +0900 (JST)
Subject: [ruby-changes:33879] ko1:r45960 (trunk): * gc.c (gc_marks, gc_marks_body): increase the counter of young objects
ko1 2014-05-16 17:41:06 +0900 (Fri, 16 May 2014) New Revision: 45960 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45960 Log: * gc.c (gc_marks, gc_marks_body): increase the counter of young objects at the major GC because AGE2Promotion changes all old objects into young objects at major GC. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 45959) +++ ChangeLog (revision 45960) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri May 16 17:38:22 2014 Koichi Sasada <ko1@a...> + + * gc.c (gc_marks, gc_marks_body): increase the counter of young objects + at the major GC because AGE2Promotion changes all old objects into + young objects at major GC. + Fri May 16 17:26:24 2014 Koichi Sasada <ko1@a...> * gc.c (gc_before_sweep): heap_pages_swept_slots should contains Index: gc.c =================================================================== --- gc.c (revision 45959) +++ gc.c (revision 45960) @@ -4210,6 +4210,12 @@ gc_marks_body(rb_objspace_t *objspace, i https://github.com/ruby/ruby/blob/trunk/gc.c#L4210 } else { objspace->profile.major_gc_count++; +#if RGENGC_AGE2_PROMOTION + /* all old objects change to young objects */ + objspace->rgengc.young_object_count += objspace->rgengc.old_object_count; +#endif + objspace->rgengc.remembered_shady_object_count = 0; + objspace->rgengc.old_object_count = 0; rgengc_mark_and_rememberset_clear(objspace, heap_eden); } #endif @@ -4570,9 +4576,6 @@ gc_marks(rb_objspace_t *objspace, int fu https://github.com/ruby/ruby/blob/trunk/gc.c#L4576 gc_verify_internal_consistency(Qnil); #endif if (full_mark == TRUE) { /* major/full GC */ - objspace->rgengc.remembered_shady_object_count = 0; - objspace->rgengc.old_object_count = 0; - gc_marks_body(objspace, TRUE); { /* See the comment about RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/