ruby-changes:30012
From: ko1 <ko1@a...>
Date: Fri, 19 Jul 2013 15:34:50 +0900 (JST)
Subject: [ruby-changes:30012] ko1:r42064 (trunk): * array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR().
ko1 2013-07-19 15:34:18 +0900 (Fri, 19 Jul 2013) New Revision: 42064 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42064 Log: * array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR(). Clearing memory space doesn't need WBs. Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 42063) +++ array.c (revision 42064) @@ -797,8 +797,10 @@ rb_ary_store(VALUE ary, long idx, VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L797 ary_double_capa(ary, idx); } if (idx > RARRAY_LEN(ary)) { - rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary), + RARRAY_PTR_USE(ary, ptr, { + rb_mem_clear(ptr + RARRAY_LEN(ary), idx-RARRAY_LEN(ary) + 1); + }); } if (idx >= RARRAY_LEN(ary)) { Index: ChangeLog =================================================================== --- ChangeLog (revision 42063) +++ ChangeLog (revision 42064) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jul 19 15:32:57 2013 Koichi Sasada <ko1@a...> + + * array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR(). + Clearing memory space doesn't need WBs. + Fri Jul 19 15:19:37 2013 Koichi Sasada <ko1@a...> * array.c (ary_ensure_room_for_push): use RARRAY_RAWPTR() instead of -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/