aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-19 10:16:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-19 10:16:31 +0000
commit5ef247aa60049300428310ff38af5d7a798df416 (patch)
tree69be23672163bd16ee0d9317050b4d01eb1e42e7
parent01bf495286cd0a0f24c4b18982630309566be527 (diff)
downloadruby-5ef247aa60049300428310ff38af5d7a798df416.tar.gz
* array.c (rb_ary_resurrect): use RARRAY_RAWPTR() because there is no
writing. * array.c (rb_ary_new_from_values): use ary_memcpy(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--array.c9
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index bdfd7c34c5..171a376427 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jul 19 19:15:30 2013 Koichi Sasada <ko1@atdot.net>
+
+ * array.c (rb_ary_resurrect): use RARRAY_RAWPTR() because there is no
+ writing.
+
+ * array.c (rb_ary_new_from_values): use ary_memcpy().
+
Fri Jul 19 19:07:31 2013 Koichi Sasada <ko1@atdot.net>
* array.c (ary_memcpy): add a function to copy VALUEs into ary
diff --git a/array.c b/array.c
index 4d025796c4..434881324b 100644
--- a/array.c
+++ b/array.c
@@ -11,7 +11,7 @@
**********************************************************************/
-#define RGENGC_UNPROTECT_LOGGING 0
+#define RGENGC_UNPROTECT_LOGGING 1
#if RGENGC_UNPROTECT_LOGGING
static void ary_unprotect_logging(void *x, const char *filename, int line);
#define RGENGC_LOGGING_WB_UNPROTECT(x, f, l) ary_unprotect_logging((void *)x, f, l)
@@ -543,10 +543,7 @@ rb_ary_new_from_values(long n, const VALUE *elts)
ary = rb_ary_new2(n);
if (n > 0 && elts) {
- assert(!OBJ_PROMOTED(ary));
- RARRAY_PTR_USE(ary, ptr, {
- MEMCPY(ptr, elts, VALUE, n); /* new array is not old gen */
- });
+ ary_memcpy(ary, 0, n, elts);
ARY_SET_LEN(ary, n);
}
@@ -1891,7 +1888,7 @@ rb_ary_dup(VALUE ary)
VALUE
rb_ary_resurrect(VALUE ary)
{
- return rb_ary_new4(RARRAY_LEN(ary), RARRAY_PTR(ary));
+ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_RAWPTR(ary));
}
extern VALUE rb_output_fs;