ruby-changes:30618
From: ko1 <ko1@a...>
Date: Tue, 27 Aug 2013 11:49:14 +0900 (JST)
Subject: [ruby-changes:30618] ko1:r42697 (trunk): * gc.c (gc_profile_clear): do rest_sweep() before clearing
ko1 2013-08-27 11:49:08 +0900 (Tue, 27 Aug 2013) New Revision: 42697 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42697 Log: * gc.c (gc_profile_clear): do rest_sweep() before clearing profile.current_record. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 42696) +++ ChangeLog (revision 42697) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Aug 27 11:46:31 2013 Koichi Sasada <ko1@a...> + + * gc.c (gc_profile_clear): do rest_sweep() before clearing + profile.current_record. + Tue Aug 27 07:35:05 2013 Aaron Patterson <aaron@t...> * io.c (io_read_nonblock): support non-blocking reads without raising Index: gc.c =================================================================== --- gc.c (revision 42696) +++ gc.c (revision 42697) @@ -5290,6 +5290,11 @@ gc_profile_clear(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L5290 { rb_objspace_t *objspace = &rb_objspace; + /* This method doesn't change profile.run status. + * While lazy sweeping, it is possible to touch zero-cleared profile.current_record. + */ + gc_rest_sweep(objspace); + if (GC_PROFILE_RECORD_DEFAULT_SIZE * 2 < objspace->profile.size) { objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE * 2; objspace->profile.records = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/