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

ruby-changes:38906

From: nobu <ko1@a...>
Date: Sun, 21 Jun 2015 21:29:15 +0900 (JST)
Subject: [ruby-changes:38906] nobu:r50987 (trunk): array.c: use ALLOCV_N

nobu	2015-06-21 21:28:20 +0900 (Sun, 21 Jun 2015)

  New Revision: 50987

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

  Log:
    array.c: use ALLOCV_N
    
    * array.c (rb_ary_permutation): use ALLOCV_N instead of ALLOCV.

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 50986)
+++ array.c	(revision 50987)
@@ -4984,7 +4984,7 @@ rb_ary_permutation(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/array.c#L4984
     }
     else {             /* this is the general case */
 	volatile VALUE t0;
-	long *p = (long*)ALLOCV(t0, r*sizeof(long)+n*sizeof(char));
+	long *p = ALLOCV_N(long, t0, r+roomof(n, sizeof(long)));
 	char *used = (char*)(p + r);
 	VALUE ary0 = ary_make_shared_copy(ary); /* private defensive copy of ary */
 	RBASIC_CLEAR_CLASS(ary0);

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

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