ruby-changes:41057
From: nobu <ko1@a...>
Date: Wed, 16 Dec 2015 00:32:51 +0900 (JST)
Subject: [ruby-changes:41057] nobu:r53132 (trunk): enumerator.c: use ALLOCV
nobu 2015-12-16 00:32:28 +0900 (Wed, 16 Dec 2015) New Revision: 53132 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53132 Log: enumerator.c: use ALLOCV * enumerator.c (lazy_init_iterator): use ALLOCV instead of tmp array. Modified files: trunk/enumerator.c Index: enumerator.c =================================================================== --- enumerator.c (revision 53131) +++ enumerator.c (revision 53132) @@ -1331,14 +1331,14 @@ lazy_init_iterator(RB_BLOCK_CALL_FUNC_AR https://github.com/ruby/ruby/blob/trunk/enumerator.c#L1331 else { VALUE args; int len = rb_long2int((long)argc + 1); + VALUE *nargv = ALLOCV_N(VALUE, args, len); - args = rb_ary_tmp_new(len); - rb_ary_push(args, m); + nargv[0] = m; if (argc > 0) { - rb_ary_cat(args, argv, argc); + MEMCPY(nargv + 1, argv, VALUE, argc); } - result = rb_yield_values2(len, RARRAY_CONST_PTR(args)); - RB_GC_GUARD(args); + result = rb_yield_values2(len, nargv); + ALLOCV_END(args); } if (result == Qundef) rb_iter_break(); return Qnil; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/