summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-21 12:28:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-21 12:28:20 +0000
commit4a686ebcd39cd178f16739b52c1103b7c394f8b8 (patch)
treef64f023485ca4c61d2d85522a94319cc40c3b0e9 /array.c
parentbbe805f09e48b5f2fd99b7cbadec69ccb73974e4 (diff)
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
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
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);