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

ruby-changes:30029

From: ko1 <ko1@a...>
Date: Sat, 20 Jul 2013 15:24:22 +0900 (JST)
Subject: [ruby-changes:30029] ko1:r42081 (trunk): * array.c (rb_ary_resize): use simple memcpy because there are no new

ko1	2013-07-20 15:24:11 +0900 (Sat, 20 Jul 2013)

  New Revision: 42081

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

  Log:
    * array.c (rb_ary_resize): use simple memcpy because there are no new
      references.

  Modified files:
    trunk/ChangeLog
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 42080)
+++ array.c	(revision 42081)
@@ -623,7 +623,6 @@ ary_make_shared(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L623
     }
 }
 
-
 static VALUE
 ary_make_substitution(VALUE ary)
 {
@@ -1642,7 +1641,7 @@ rb_ary_resize(VALUE ary, long len) https://github.com/ruby/ruby/blob/trunk/array.c#L1641
 	VALUE tmp[RARRAY_EMBED_LEN_MAX];
 	MEMCPY(tmp, ARY_HEAP_PTR(ary), VALUE, len);
 	ary_discard(ary);
-	ary_memcpy(ary, 0, len, tmp);
+	MEMCPY((VALUE *)ARY_EMBED_PTR(ary), tmp, VALUE, len); /* WB: no new reference */
         ARY_SET_EMBED_LEN(ary, len);
     }
     else {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42080)
+++ ChangeLog	(revision 42081)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jul 20 15:22:38 2013  Koichi Sasada  <ko1@a...>
+
+	* array.c (rb_ary_resize): use simple memcpy because there are no new
+	  references.
+
 Sat Jul 20 15:02:51 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* safe.c (ruby_safe_level_4_warning): define for old extension

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

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