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

ruby-changes:29458

From: tarui <ko1@a...>
Date: Fri, 21 Jun 2013 08:08:47 +0900 (JST)
Subject: [ruby-changes:29458] tarui:r41510 (trunk): * gc.c (lazy_sweep): Use is_lazy_sweeping()

tarui	2013-06-21 08:08:30 +0900 (Fri, 21 Jun 2013)

  New Revision: 41510

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

  Log:
    * gc.c (lazy_sweep): Use is_lazy_sweeping()
    * gc.c (rest_sweep): Ditto.
    * gc.c (gc_prepare_free_objects): Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41509)
+++ ChangeLog	(revision 41510)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun 21 08:08:11 2013  Masaya Tarui  <tarui@r...>
+
+	* gc.c (lazy_sweep): Use is_lazy_sweeping()
+	* gc.c (rest_sweep): Ditto.
+	* gc.c (gc_prepare_free_objects): Ditto.
+
 Fri Jun 21 07:34:47 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_profile_record::oldgen_objects): added.
Index: gc.c
===================================================================
--- gc.c	(revision 41509)
+++ gc.c	(revision 41510)
@@ -427,6 +427,7 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_ https://github.com/ruby/ruby/blob/trunk/gc.c#L427
 #define initial_free_min	initial_params.initial_free_min
 #define initial_growth_factor	initial_params.initial_growth_factor
 
+
 #define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
 
 #if SIZEOF_LONG == SIZEOF_VOIDP
@@ -2422,7 +2423,7 @@ lazy_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2423
     gc_prof_sweep_timer_start(objspace);
 
     heaps_increment(objspace);
-    while (objspace->heap.sweep_slots) {
+    while (is_lazy_sweeping(objspace)) {
         next = objspace->heap.sweep_slots->next;
 	slot_sweep(objspace, objspace->heap.sweep_slots);
         objspace->heap.sweep_slots = next;
@@ -2443,9 +2444,9 @@ lazy_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2444
 static void
 rest_sweep(rb_objspace_t *objspace)
 {
-    if (objspace->heap.sweep_slots) {
+    if (is_lazy_sweeping(objspace)) {
 	during_gc++;
-	while (objspace->heap.sweep_slots) {
+	while (is_lazy_sweeping(objspace)) {
 	    lazy_sweep(objspace);
 	}
 	during_gc = 0;
@@ -2498,7 +2499,7 @@ gc_prepare_free_objects(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/gc.c#L2499
 
     during_gc++;
 
-    if (objspace->heap.sweep_slots) {
+    if (is_lazy_sweeping(objspace)) {
 	if (lazy_sweep(objspace)) {
 	    during_gc = 0;
 	    return TRUE;

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

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