1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_zip): use ALLOCV_N() instead of ALLOCA_N().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
glass 2014-01-01 15:55:51 +00:00
parent edc5eb0d3b
commit 56b0396944
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Jan 2 00:53:16 2014 Masaki Matsushita <glass.saga@gmail.com>
* array.c (rb_ary_zip): use ALLOCV_N() instead of ALLOCA_N().
Thu Jan 2 00:04:29 2014 Masaki Matsushita <glass.saga@gmail.com>
* hash.c (rb_hash_keys): make rb_hash_keys() static.

View file

@ -3240,8 +3240,10 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
if (rb_block_given_p()) {
int arity = rb_block_arity();
if (arity > 1 && argc+1 < 0x100) {
VALUE *tmp = ALLOCA_N(VALUE, argc+1);
if (arity > 1) {
VALUE work, *tmp;
tmp = ALLOCV_N(VALUE, work, argc+1);
for (i=0; i<RARRAY_LEN(ary); i++) {
tmp[0] = RARRAY_AREF(ary, i);
@ -3250,6 +3252,8 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
}
rb_yield_values2(argc+1, tmp);
}
if (work) ALLOCV_END(work);
}
else {
for (i=0; i<RARRAY_LEN(ary); i++) {