From 15112cf003008c44eab12e9054c5f4a907102a26 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 22 Oct 2007 15:29:17 +0000 Subject: [PATCH] * enum.c (enum_cycle): hide temporary array from ObjectSpace. [ruby-core:12762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ enum.c | 11 +++++++---- version.h | 6 +++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd4126a528..291d8fcf78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,11 @@ Sun Oct 21 18:29:17 2007 Nobuyoshi Nakada * encoding.c (set_primary_encoding): removed primary_encoding setter. +Sat Oct 20 13:17:01 2007 Yukihiro Matsumoto + + * enum.c (enum_cycle): hide temporary array from ObjectSpace. + [ruby-core:12762] + Sat Oct 20 11:49:20 2007 Nobuyoshi Nakada * file.c (rb_get_path): returns frozen string. diff --git a/enum.c b/enum.c index 0a64b5740d..82a64fe0a3 100644 --- a/enum.c +++ b/enum.c @@ -1541,17 +1541,20 @@ static VALUE enum_cycle(VALUE obj) { VALUE ary; - long i; + long i, len; RETURN_ENUMERATOR(obj, 0, 0); ary = rb_ary_new(); + RBASIC(ary)->klass = 0; rb_block_call(obj, id_each, 0, 0, cycle_i, ary); - while (RARRAY_LEN(ary) > 0) { - for (i=0; i