ruby-changes:37942
From: ko1 <ko1@a...>
Date: Thu, 19 Mar 2015 16:11:29 +0900 (JST)
Subject: [ruby-changes:37942] ko1:r50023 (trunk): * gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
ko1 2015-03-19 16:10:58 +0900 (Thu, 19 Mar 2015) New Revision: 50023 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50023 Log: * gc.c (rb_copy_wb_protected_attribute): need demote for old objects. Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50022) +++ ChangeLog (revision 50023) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Mar 19 16:08:42 2015 Koichi Sasada <ko1@a...> + + * gc.c (rb_copy_wb_protected_attribute): need demote for old objects. + Thu Mar 19 10:31:00 2015 Nobuyoshi Nakada <nobu@r...> * random.c (fill_random_bytes): release the handle in the static Index: gc.c =================================================================== --- gc.c (revision 50022) +++ gc.c (revision 50023) @@ -5730,9 +5730,16 @@ void https://github.com/ruby/ruby/blob/trunk/gc.c#L5730 rb_copy_wb_protected_attribute(VALUE dest, VALUE obj) { #if USE_RGENGC + rb_objspace_t *objspace = &rb_objspace; + if (RVALUE_WB_UNPROTECTED(obj)) { - MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(dest), dest); - RVALUE_AGE_RESET_RAW(dest); + if (!RVALUE_OLD_P(dest)) { + MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(dest), dest); + RVALUE_AGE_RESET_RAW(dest); + } + else { + RVALUE_DEMOTE(objspace, obj); + } } check_rvalue_consistency(dest); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/