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

ruby-changes:29948

From: ko1 <ko1@a...>
Date: Tue, 16 Jul 2013 17:46:26 +0900 (JST)
Subject: [ruby-changes:29948] ko1:r42000 (trunk): * gc.c (link_free_heap_slot): removed.

ko1	2013-07-16 17:46:15 +0900 (Tue, 16 Jul 2013)

  New Revision: 42000

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

  Log:
    * gc.c (link_free_heap_slot): removed.
    * gc.c (slot_sweep): use `heaps_add_freeslot' instead of
      `link_free_heap_slot'.
    * gc.c (assign_heap_slot): use local variable `slot' instead of
      `heaps'.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41999)
+++ ChangeLog	(revision 42000)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul 16 17:43:22 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (link_free_heap_slot): removed.
+
+	* gc.c (slot_sweep): use `heaps_add_freeslot' instead of
+	  `link_free_heap_slot'.
+
+	* gc.c (assign_heap_slot): use local variable `slot' instead of
+	  `heaps'.
+
 Tue Jul 16 17:21:39 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (assign_heap_slot): refactoring variable names.
Index: gc.c
===================================================================
--- gc.c	(revision 41999)
+++ gc.c	(revision 42000)
@@ -733,13 +733,6 @@ allocate_sorted_heaps(rb_objspace_t *obj https://github.com/ruby/ruby/blob/trunk/gc.c#L733
 }
 
 static void
-link_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
-{
-    slot->free_next = objspace->heap.free_slots;
-    objspace->heap.free_slots = slot;
-}
-
-static void
 unlink_free_heap_slot(rb_objspace_t *objspace, struct heaps_slot *slot)
 {
     objspace->heap.free_slots = slot->free_next;
@@ -791,8 +784,8 @@ assign_heap_slot(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L784
     MEMZERO((void*)slot, struct heaps_slot, 1);
 
     slot->header = header;
-    slot->next = objspace->heap.ptr;
 
+    slot->next = objspace->heap.ptr;
     if (objspace->heap.ptr) objspace->heap.ptr->prev = slot;
     objspace->heap.ptr = slot;
 
@@ -841,7 +834,7 @@ assign_heap_slot(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L834
 	slot_add_freeobj(objspace, slot, (VALUE)p);
     }
 
-    heaps_add_freeslot(objspace, heaps);
+    heaps_add_freeslot(objspace, slot);
 }
 
 static void
@@ -2294,12 +2287,12 @@ slot_sweep(rb_objspace_t *objspace, stru https://github.com/ruby/ruby/blob/trunk/gc.c#L2287
         unlink_heap_slot(objspace, sweep_slot);
     }
     else {
-        if (freed_num + empty_num > 0) {
-            link_free_heap_slot(objspace, sweep_slot);
-        }
-        else {
-            sweep_slot->free_next = NULL;
-        }
+	if (freed_num + empty_num > 0) {
+	    heaps_add_freeslot(objspace, sweep_slot);
+	}
+	else {
+	    sweep_slot->free_next = NULL;
+	}
 	objspace->heap.free_num += freed_num + empty_num;
     }
     objspace->total_freed_object_num += freed_num;

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

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