summaryrefslogtreecommitdiff
path: root/array.c
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 /array.c
parent01bf495286cd0a0f24c4b18982630309566be527 (diff)
* 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
Diffstat (limited to 'array.c')
-rw-r--r--array.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/array.c b/array.c
index 4d02579..4348813 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;