summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 04:21:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 04:21:01 +0000
commit8160fab8bcdd7dc4e70ae0ddd195d4dc942f8637 (patch)
treeb85d09460cde33c51a58bffa648064f39eb788be /array.c
parent8eb0a3cd5020ba2eeb540e4fd81fb88e43305ae4 (diff)
* array.c (ary_resize_capa): use RARRAY_RAWPTR() because
this code creates no new references. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index c05ee1a..8022ab2 100644
--- a/array.c
+++ b/array.c
@@ -263,12 +263,12 @@ ary_resize_capa(VALUE ary, long capacity)
else {
if (!ARY_EMBED_P(ary)) {
long len = RARRAY_LEN(ary);
- VALUE *ptr = RARRAY_PTR(ary);
+ const VALUE *ptr = RARRAY_RAWPTR(ary);
if (len > capacity) len = capacity;
MEMCPY((VALUE *)RARRAY(ary)->as.ary, ptr, VALUE, len);
FL_SET_EMBED(ary);
ARY_SET_LEN(ary, len);
- xfree(ptr);
+ xfree((VALUE *)ptr);
}
}
}