[前][次][番号順一覧][スレッド一覧]

ruby-changes:28916

From: ko1 <ko1@a...>
Date: Tue, 28 May 2013 02:46:35 +0900 (JST)
Subject: [ruby-changes:28916] ko1:r40968 (trunk): * gc.c (garbage_collect_body): fix GC_ENABLE_LAZY_SWEEP condition.

ko1	2013-05-28 02:46:20 +0900 (Tue, 28 May 2013)

  New Revision: 40968

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40968

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40967)
+++ ChangeLog	(revision 40968)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue May 28 02:44:23 2013  Koichi Sasada  <ko1@a...>
+
+	* 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.
+
 Tue May 28 02:07:21 2013  Koichi Sasada  <ko1@a...>
 
 	* vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
Index: gc.c
===================================================================
--- gc.c	(revision 40967)
+++ gc.c	(revision 40968)
@@ -3805,7 +3805,7 @@ garbage_collect_body(rb_objspace_t *objs https://github.com/ruby/ruby/blob/trunk/gc.c#L3805
 	}
     }
 
-    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 *objs https://github.com/ruby/ruby/blob/trunk/gc.c#L3813
 	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 *objs https://github.com/ruby/ruby/blob/trunk/gc.c#L3826
     }
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]