From 4a686ebcd39cd178f16739b52c1103b7c394f8b8 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 21 Jun 2015 12:28:20 +0000 Subject: array.c: use ALLOCV_N * array.c (rb_ary_permutation): use ALLOCV_N instead of ALLOCV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'array.c') diff --git a/array.c b/array.c index 7eb27cd915..5953dfcaf8 100644 --- a/array.c +++ b/array.c @@ -4984,7 +4984,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary) } 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); -- cgit v1.2.3