[前][次][番号順一覧][スレッド一覧]

ruby-changes:42844

From: nobu <ko1@a...>
Date: Thu, 5 May 2016 15:30:32 +0900 (JST)
Subject: [ruby-changes:42844] nobu:r54918 (trunk): proc.c: no temporary args array

nobu	2016-05-05 16:27:10 +0900 (Thu, 05 May 2016)

  New Revision: 54918

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54918

  Log:
    proc.c: no temporary args array
    
    * proc.c (bmcall): method proc is always lambda, args is the array
      which is made from argc and argv.

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 54917)
+++ proc.c	(revision 54918)
@@ -2529,16 +2529,7 @@ mlambda(VALUE method) https://github.com/ruby/ruby/blob/trunk/proc.c#L2529
 static VALUE
 bmcall(VALUE args, VALUE method, int argc, VALUE *argv, VALUE passed_proc)
 {
-    volatile VALUE a;
-    VALUE ret;
-
-    if (CLASS_OF(args) != rb_cArray) {
-	return rb_method_call_with_block(1, &args, method, passed_proc);
-    }
-    argc = check_argc(RARRAY_LEN(args));
-    ret = rb_method_call_with_block(argc, RARRAY_PTR(args), method, passed_proc);
-    RB_GC_GUARD(a) = args;
-    return ret;
+    return rb_method_call_with_block(argc, argv, method, passed_proc);
 }
 
 VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]