summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-19 06:34:18 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-19 06:34:18 +0000
commit77887cf01c1ddfcfc471462fb87b805b2d5c4498 (patch)
tree31a488588941ec60a4b596191c2fb4be7de0b2d8 /array.c
parentb9b5a2ccab4555dd8e063870a15454d919a1d322 (diff)
* array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR().
Clearing memory space doesn't need WBs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/array.c b/array.c
index 46f3794..f3f1b2e 100644
--- a/array.c
+++ b/array.c
@@ -797,8 +797,10 @@ rb_ary_store(VALUE ary, long idx, VALUE val)
ary_double_capa(ary, idx);
}
if (idx > RARRAY_LEN(ary)) {
- rb_mem_clear(RARRAY_PTR(ary) + RARRAY_LEN(ary),
+ RARRAY_PTR_USE(ary, ptr, {
+ rb_mem_clear(ptr + RARRAY_LEN(ary),
idx-RARRAY_LEN(ary) + 1);
+ });
}
if (idx >= RARRAY_LEN(ary)) {