From cd5cd3c6729c4c7917f4c0c69a8c323763a69968 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 Dec 2005 09:15:56 +0000 Subject: [PATCH] * gc.c (garbage_collect): mark objects refered from aborting threads. [ruby-dev:28190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ gc.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfb85ad0f0..fbe67bb655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 30 18:14:54 2005 Nobuyoshi Nakada + + * gc.c (garbage_collect): mark objects refered from aborting threads. + [ruby-dev:28190] + Fri Dec 30 15:17:35 2005 Hirokazu Yamamoto * lib/generator.rb: (Generator#initialize) ensured to stop @loop_thread. diff --git a/gc.c b/gc.c index 2d25d51fb5..b1552c839b 100644 --- a/gc.c +++ b/gc.c @@ -1017,8 +1017,6 @@ gc_sweep(void) st_foreach(source_filenames, sweep_source_filename, 0); } - rb_gc_abort_threads(); - freelist = 0; final_list = deferred_final_list; deferred_final_list = 0; @@ -1344,14 +1342,18 @@ garbage_collect(void) rb_gc_mark_parser(); /* gc_mark objects whose marking are not completed*/ - while (!MARK_STACK_EMPTY){ - if (mark_stack_overflow){ - gc_mark_all(); + do { + while (!MARK_STACK_EMPTY) { + if (mark_stack_overflow){ + gc_mark_all(); + } + else { + gc_mark_rest(); + } } - else { - gc_mark_rest(); - } - } + rb_gc_abort_threads(); + } while (!MARK_STACK_EMPTY); + gc_sweep(); return Qtrue;