diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-21 12:28:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-21 12:28:20 +0000 |
commit | 4a686ebcd39cd178f16739b52c1103b7c394f8b8 (patch) | |
tree | f64f023485ca4c61d2d85522a94319cc40c3b0e9 | |
parent | bbe805f09e48b5f2fd99b7cbadec69ccb73974e4 (diff) | |
download | ruby-4a686ebcd39cd178f16739b52c1103b7c394f8b8.tar.gz |
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
-rw-r--r-- | array.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |