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

ruby-changes:16225

From: tarui <ko1@a...>
Date: Sun, 6 Jun 2010 23:46:55 +0900 (JST)
Subject: [ruby-changes:16225] Ruby:r28191 (ruby_1_9_2): * gc.c (heaps_slot, assign_heap_slot, gc_sweep): skip sweep if

tarui	2010-06-06 23:46:39 +0900 (Sun, 06 Jun 2010)

  New Revision: 28191

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

  Log:
    * gc.c (heaps_slot, assign_heap_slot, gc_sweep): skip sweep if
       heap_slot's status is pre-free phase.  [ruby-dev:41543]

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/gc.c

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 28190)
+++ ruby_1_9_2/ChangeLog	(revision 28191)
@@ -1,3 +1,8 @@
+Sun Jun  6 23:35:12 2010  Masaya Tarui  <tarui@r...>
+
+	* gc.c (heaps_slot, assign_heap_slot, gc_sweep): skip sweep if
+	  heap_slot's status is pre-free phase.  [ruby-dev:41543]
+
 Sun Jun  6 22:37:11 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* string.c (rb_str_buf_cat_escaped_char): get rid of buffer
Index: ruby_1_9_2/gc.c
===================================================================
--- ruby_1_9_2/gc.c	(revision 28190)
+++ ruby_1_9_2/gc.c	(revision 28191)
@@ -280,6 +280,7 @@
     void *membase;
     RVALUE *slot;
     size_t limit;
+    int finalize_flag;
 };
 
 #define HEAP_MIN_SLOTS 10000
@@ -938,6 +939,7 @@
     heaps[hi].membase = membase;
     heaps[hi].slot = p;
     heaps[hi].limit = objs;
+    heaps[hi].finalize_flag = FALSE;
     pend = p + objs;
     if (lomem == 0 || lomem > p) lomem = p;
     if (himem < pend) himem = pend;
@@ -1874,6 +1876,8 @@
 	RVALUE *final = final_list;
 	int deferred;
 
+	if(heaps[i].finalize_flag) continue;
+
 	p = heaps[i].slot; pend = p + heaps[i].limit;
 	while (p < pend) {
 	    if (!(p->as.basic.flags & FL_MARK)) {
@@ -1912,7 +1916,7 @@
 		pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
 	    }
 	    heaps[i].limit = final_num;
-
+	    heaps[i].finalize_flag = TRUE;
 	    freelist = free;	/* cancel this page from freelist */
 	}
 	else {

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

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