summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 06:24:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 06:24:11 +0000
commit3a20287053640a97896f701f264f8a0fccec7c6a (patch)
tree3b1b2ffd807e9254342e07964e73c8621a485fed
parenta4fefc954e89b1f834f3d0aac8f1958179d235a6 (diff)
* array.c (rb_ary_resize): use simple memcpy because there are no new
references. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--array.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9e0f211..6049cd0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 20 15:22:38 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_resize): use simple memcpy because there are no new
+ references.
+
Sat Jul 20 15:02:51 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* safe.c (ruby_safe_level_4_warning): define for old extension
diff --git a/array.c b/array.c
index 30786f8..eeeb989 100644
--- a/array.c
+++ b/array.c
@@ -623,7 +623,6 @@ ary_make_shared(VALUE ary)
}
}
-
static VALUE
ary_make_substitution(VALUE ary)
{
@@ -1642,7 +1641,7 @@ rb_ary_resize(VALUE ary, long len)
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 {