* 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
This commit is contained in:
ko1 2013-07-19 06:34:18 +00:00
parent b9b5a2ccab
commit 77887cf01c
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Fri Jul 19 15:32:57 2013 Koichi Sasada <ko1@atdot.net>
* array.c (rb_ary_store): use RARRAY_PTR_USE() intead of RARRAY_PTR().
Clearing memory space doesn't need WBs.
Fri Jul 19 15:19:37 2013 Koichi Sasada <ko1@atdot.net>
* array.c (ary_ensure_room_for_push): use RARRAY_RAWPTR() instead of

View File

@ -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)) {