summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 17:46:20 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 17:46:20 +0000
commit8a81b54a2b9cf5349c882659fd3b2bc7995bc633 (patch)
tree68c239be1745f00411b2d4008924c98bf13769a4 /gc.c
parentc180e0d8801a8fb1f4d900d6a7e36ccb7d4f557e (diff)
* gc.c (garbage_collect_body): fix GC_ENABLE_LAZY_SWEEP condition.
* gc.c (GC_NOTIFY): move debug print location and use stderr instead of stdout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index 8b998bb47a..e36b05dd65 100644
--- a/gc.c
+++ b/gc.c
@@ -3805,7 +3805,7 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep
}
}
- if (GC_ENABLE_LAZY_SWEEP || objspace->flags.dont_lazy_sweep) {
+ if (!GC_ENABLE_LAZY_SWEEP || objspace->flags.dont_lazy_sweep) {
immediate_sweep = TRUE;
}
@@ -3813,6 +3813,8 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep
objspace->rgengc.oldgen_object_count = 0;
}
+ if (GC_NOTIFY) fprintf(stderr, "start garbage_collect(%d, %d, %d)\n", full_mark, immediate_sweep, reason);
+
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_START, 0 /* TODO: pass minor/immediate flag? */);
gc_prof_timer_start(objspace, reason | (minor_gc ? GPR_FLAG_MINOR : 0));
@@ -3824,15 +3826,13 @@ garbage_collect_body(rb_objspace_t *objspace, int full_mark, int immediate_sweep
}
gc_prof_timer_stop(objspace);
- if (GC_NOTIFY) printf("end garbage_collect()\n");
+ if (GC_NOTIFY) fprintf(stderr, "end garbage_collect()\n");
return TRUE;
}
static int
garbage_collect(rb_objspace_t *objspace, int full_mark, int immediate_sweep, int reason)
{
- if (GC_NOTIFY) printf("start garbage_collect(%d, %d, %d)\n", full_mark, immediate_sweep, reason);
-
if (!heaps) {
during_gc = 0;
return FALSE;