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

ruby-changes:31641

From: ko1 <ko1@a...>
Date: Tue, 19 Nov 2013 18:52:57 +0900 (JST)
Subject: [ruby-changes:31641] ko1:r43720 (trunk): * gc.c (heap_is_swept_object): use heap_page::before_sweep flag.

ko1	2013-11-19 18:52:52 +0900 (Tue, 19 Nov 2013)

  New Revision: 43720

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

  Log:
    * gc.c (heap_is_swept_object): use heap_page::before_sweep flag.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43719)
+++ ChangeLog	(revision 43720)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov 19 18:52:10 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (heap_is_swept_object): use heap_page::before_sweep flag.
+
 Tue Nov 19 18:49:32 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (rb_objspace_reachable_objects_from_root): do major marking.
Index: gc.c
===================================================================
--- gc.c	(revision 43719)
+++ gc.c	(revision 43720)
@@ -2168,12 +2168,8 @@ is_id_value(rb_objspace_t *objspace, VAL https://github.com/ruby/ruby/blob/trunk/gc.c#L2168
 static inline int
 heap_is_swept_object(rb_objspace_t *objspace, rb_heap_t *heap, VALUE ptr)
 {
-    struct heap_page *page = heap->sweep_pages;
-    while (page) {
-	if ((VALUE)page->start <= ptr && ptr < (VALUE)(page->start + page->limit)) return FALSE;
-	page = page->next;
-    }
-    return TRUE;
+    struct heap_page *page = GET_HEAP_PAGE(ptr);
+    return page->before_sweep ? FALSE : TRUE;
 }
 
 static inline int

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

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