Project

General

Profile

Bug #9942

reduce memory allocation in Array#permutation (fixed at r46416)

Added by nagachika (Tomoyuki Chikanaga) over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
-
[ruby-dev:48292]

Description

rb_ary_permutation() allocate unnecessary large temporary array.
It's fixed at r46416.

This ticket is only for backport management.

Associated revisions

Revision aa8380e1
Added by nagachika (Tomoyuki Chikanaga) about 5 years ago

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 46807
Added by nagachika (Tomoyuki Chikanaga) about 5 years ago

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.

Revision 1abe5c8d
Added by usa (Usaku NAKAMURA) about 5 years ago

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

Revision 47331
Added by usa (Usaku NAKAMURA) about 5 years ago

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) about 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) about 5 years ago

Backported into ruby_2_0_0 at r47331.

Updated by usa (Usaku NAKAMURA) about 5 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

Also available in: Atom PDF