зеркало из https://github.com/github/ruby.git
* array.c (rb_ary_pop): may cause realloc oscillation. a patch
from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>. [ruby-dev:29028] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5d11f0072c
Коммит
05a34a764d
|
@ -1,3 +1,9 @@
|
|||
Fri Jul 14 00:10:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_pop): may cause realloc oscillation. a patch
|
||||
from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>.
|
||||
[ruby-dev:29028]
|
||||
|
||||
Thu Jul 13 22:23:56 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/lib/tk/composite.rb: improve handling of the classname on the
|
||||
|
|
2
array.c
2
array.c
|
@ -454,7 +454,7 @@ rb_ary_pop(VALUE ary)
|
|||
rb_ary_modify_check(ary);
|
||||
if (RARRAY(ary)->len == 0) return Qnil;
|
||||
if (!FL_TEST(ary, ELTS_SHARED) &&
|
||||
RARRAY(ary)->len * 2 < RARRAY(ary)->aux.capa &&
|
||||
RARRAY(ary)->len * 3 < RARRAY(ary)->aux.capa &&
|
||||
RARRAY(ary)->aux.capa > ARY_DEFAULT_SIZE) {
|
||||
RARRAY(ary)->aux.capa = RARRAY(ary)->len * 2;
|
||||
REALLOC_N(RARRAY(ary)->ptr, VALUE, RARRAY(ary)->aux.capa);
|
||||
|
|
Загрузка…
Ссылка в новой задаче