Bug #9942
reduce memory allocation in Array#permutation (fixed at r46416)
Description
rb_ary_permutation() allocate unnecessary large temporary array.
It's fixed at r46416.
This ticket is only for backport management.
Associated revisions
merge revision(s) r46416: [Backport #9942]
* array.c (rb_ary_permutation): `p` is the array of size `r`, as commented at permute0(). since `n >= r` here, buffer overflow never happened, just reduce unnecessary allocation though.
merge revision(s) 46416: [Backport #9942]
* array.c (rb_ary_permutation): `p` is the array of size `r`, as commented at permute0(). since `n >= r` here, buffer overflow never happened, just reduce unnecessary allocation though.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 46416: [Backport #9942]
* array.c (rb_ary_permutation): `p` is the array of size `r`, as commented at permute0(). since `n >= r` here, buffer overflow never happened, just reduce unnecessary allocation though.
History
Updated by nagachika (Tomoyuki Chikanaga) over 5 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE
Backported into ruby_2_1
branch at r46807.
Updated by usa (Usaku NAKAMURA) over 5 years ago
Backported into ruby_2_0_0
at r47331.
Updated by usa (Usaku NAKAMURA) over 5 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE
merge revision(s) r46416: [Backport #9942]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e