summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-30 09:15:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-30 09:15:56 +0000
commit5f0902a0981de05fa9b93d92bff9ea9b4089e0fa (patch)
treef16422522176b1dfeb6b39f3c035a4ae5d29b4b4 /gc.c
parenta7e62dd16b8fd9bb52d3d989db0154224bc8d39d (diff)
* gc.c (garbage_collect): mark objects refered from aborting threads.
[ruby-dev:28190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gc.c b/gc.c
index 244c86686f..5a2146b24c 100644
--- a/gc.c
+++ b/gc.c
@@ -1059,8 +1059,6 @@ gc_sweep()
st_foreach(source_filenames, sweep_source_filename, 0);
}
- rb_gc_abort_threads();
-
freelist = 0;
final_list = deferred_final_list;
deferred_final_list = 0;
@@ -1404,14 +1402,18 @@ garbage_collect()
rb_gc_mark_parser();
/* gc_mark objects whose marking are not completed*/
- while (!MARK_STACK_EMPTY){
- if (mark_stack_overflow){
- gc_mark_all();
- }
- else {
- gc_mark_rest();
+ do {
+ while (!MARK_STACK_EMPTY) {
+ if (mark_stack_overflow){
+ gc_mark_all();
+ }
+ else {
+ gc_mark_rest();
+ }
}
- }
+ rb_gc_abort_threads();
+ } while (!MARK_STACK_EMPTY);
+
gc_sweep();
}