зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
bbe805f09e
Коммит
4a686ebcd3
2
array.c
2
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче