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

ruby-changes:31382

From: ko1 <ko1@a...>
Date: Tue, 29 Oct 2013 16:25:52 +0900 (JST)
Subject: [ruby-changes:31382] ko1:r43461 (trunk): * gc.c (heap_page_resurrect): return a page in tomb heap even if

ko1	2013-10-29 16:25:45 +0900 (Tue, 29 Oct 2013)

  New Revision: 43461

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

  Log:
    * gc.c (heap_page_resurrect): return a page in tomb heap even if
      freelist is NULL.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43460)
+++ ChangeLog	(revision 43461)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Oct 29 16:24:52 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (heap_page_resurrect): return a page in tomb heap even if
+	  freelist is NULL.
+
 Tue Oct 29 15:46:30 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
Index: gc.c
===================================================================
--- gc.c	(revision 43460)
+++ gc.c	(revision 43461)
@@ -936,17 +936,11 @@ heap_page_resurrect(rb_objspace_t *objsp https://github.com/ruby/ruby/blob/trunk/gc.c#L936
 {
     struct heap_page *page;
 
-    if (heap_tomb->pages) {
-	page = heap_tomb->pages;
-	while (page) {
-	    if (page->freelist) {
-		heap_unlink_page(objspace, heap_tomb, page);
-		return page;
-	    }
-	    page = page->next;
-	}
+    if ((page = heap_tomb->pages) != NULL) {
+	heap_unlink_page(objspace, heap_tomb, page);
+	return page;
     }
-    return 0;
+    return NULL;
 }
 
 static struct heap_page *

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

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