[前][次][番号順一覧][スレッド一覧]

ruby-changes:31478

From: glass <ko1@a...>
Date: Wed, 6 Nov 2013 21:20:47 +0900 (JST)
Subject: [ruby-changes:31478] glass:r43557 (trunk): * array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB because

glass	2013-11-06 21:20:39 +0900 (Wed, 06 Nov 2013)

  New Revision: 43557

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43557

  Log:
    * array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB because
      there are not new relations.

  Modified files:
    trunk/ChangeLog
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 43556)
+++ array.c	(revision 43557)
@@ -1070,7 +1070,9 @@ rb_ary_shift_m(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/array.c#L1070
         ARY_INCREASE_PTR(ary, n);
     }
     else {
-	MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+n, VALUE, RARRAY_LEN(ary)-n);
+	RARRAY_PTR_USE(ary, ptr, {
+	    MEMMOVE(ptr, ptr + n, VALUE, RARRAY_LEN(ary)-n);
+	}); /* WB: no new reference */
     }
     ARY_INCREASE_LEN(ary, -n);
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43556)
+++ ChangeLog	(revision 43557)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Nov  6 21:16:51 2013  Masaki Matsushita  <glass.saga@g...>
+
+	* array.c (rb_ary_shift_m): use RARRAY_PTR_USE() without WB because
+	  there are not new relations.
+
 Wed Nov  6 21:05:20 2013  Masaki Matsushita  <glass.saga@g...>
 
 	* array.c (rb_ary_reverse): use RARRAY_PTR_USE().

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]