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;