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

ruby-changes:35406

From: ko1 <ko1@a...>
Date: Wed, 10 Sep 2014 10:42:14 +0900 (JST)
Subject: [ruby-changes:35406] ko1:r47488 (trunk): * gc.c (objspace_total_slot): rename objspace_available_slots.

ko1	2014-09-10 10:42:09 +0900 (Wed, 10 Sep 2014)

  New Revision: 47488

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

  Log:
    * gc.c (objspace_total_slot): rename objspace_available_slots.
    * gc.c (objspace_live_slot, objspace_free_slot): rename
      ..._slot() to ..._slots().
    * gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
    * gc.c (gc_stat_internal):
      * add `heap_available_slots' field
      * rename heap_live_slot to heap_live_slots
      * rename heap_free_slot to heap_free_slots
      ref: [Feature #9924]

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47487)
+++ ChangeLog	(revision 47488)
@@ -1,3 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Sep 10 10:36:08 2014  Koichi Sasada  <ko1@a...>
+
+	* gc.c (objspace_total_slot): rename objspace_available_slots.
+
+	* gc.c (objspace_live_slot, objspace_free_slot): rename
+	  ..._slot() to ..._slots().
+
+	* gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
+
+	* gc.c (gc_stat_internal):
+	  * add `heap_available_slots' field
+	  * rename heap_live_slot to heap_live_slots
+	  * rename heap_free_slot to heap_free_slots
+	  ref: [Feature #9924]
+
 Wed Sep 10 07:22:53 2014  Koichi Sasada  <ko1@a...>
 
 	* gc.c: refactoring for RGENGC_PROFILE > 0.
Index: gc.c
===================================================================
--- gc.c	(revision 47487)
+++ gc.c	(revision 47488)
@@ -3021,21 +3021,21 @@ count_objects(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/gc.c#L3021
 /* Sweeping */
 
 static size_t
-objspace_live_slot(rb_objspace_t *objspace)
+objspace_available_slots(rb_objspace_t *objspace)
 {
-    return objspace->total_allocated_objects - objspace->profile.total_freed_objects - heap_pages_final_slots;
+    return heap_eden->total_slots + heap_tomb->total_slots;
 }
 
 static size_t
-objspace_total_slot(rb_objspace_t *objspace)
+objspace_live_slots(rb_objspace_t *objspace)
 {
-    return heap_eden->total_slots + heap_tomb->total_slots;
+    return (objspace->total_allocated_objects - objspace->profile.total_freed_objects) - heap_pages_final_slots;
 }
 
 static size_t
-objspace_free_slot(rb_objspace_t *objspace)
+objspace_free_slots(rb_objspace_t *objspace)
 {
-    return objspace_total_slot(objspace) - (objspace_live_slot(objspace) - heap_pages_final_slots);
+    return objspace_available_slots(objspace) - objspace_live_slots(objspace) - heap_pages_final_slots;
 }
 
 static void
@@ -3206,7 +3206,7 @@ gc_sweep_start(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L3206
 
     /* sometimes heap_allocatable_pages is not 0 */
     heap_pages_swept_slots = heap_allocatable_pages * HEAP_OBJ_LIMIT;
-    total_limit_slot = objspace_total_slot(objspace);
+    total_limit_slot = objspace_available_slots(objspace);
 
     heap_pages_min_free_slots = (size_t)(total_limit_slot * GC_HEAP_FREE_SLOTS_MIN_RATIO);
     if (heap_pages_min_free_slots < gc_params.heap_free_slots) {
@@ -4771,10 +4771,10 @@ gc_verify_internal_consistency(VALUE sel https://github.com/ruby/ruby/blob/trunk/gc.c#L4771
     /* check counters */
 
     if (!is_lazy_sweeping(heap_eden) && !finalizing) {
-	if (objspace_live_slot(objspace) != data.live_object_count) {
+	if (objspace_live_slots(objspace) != data.live_object_count) {
 	    fprintf(stderr, "heap_pages_final_slots: %d, objspace->profile.total_freed_objects: %d\n",
 		    (int)heap_pages_final_slots, (int)objspace->profile.total_freed_objects);
-	    rb_bug("inconsistent live slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace_live_slot(objspace), data.live_object_count);
+	    rb_bug("inconsistent live slot nubmer: expect %"PRIuSIZE", but %"PRIuSIZE".", objspace_live_slots(objspace), data.live_object_count);
 	}
     }
 
@@ -6250,7 +6250,7 @@ gc_stat_internal(VALUE hash_or_sym) https://github.com/ruby/ruby/blob/trunk/gc.c#L6250
 {
     static VALUE sym_count;
     static VALUE sym_heap_used, sym_heap_sorted_length, sym_heap_allocatable_pages;
-    static VALUE sym_heap_live_slot, sym_heap_free_slot, sym_heap_final_slots;
+    static VALUE sym_heap_available_slots, sym_heap_live_slots, sym_heap_free_slots, sym_heap_final_slots;
     static VALUE sym_heap_marked_slots, sym_heap_swept_slots;
     static VALUE sym_heap_eden_pages, sym_heap_tomb_pages;
     static VALUE sym_total_allocated_objects, sym_total_freed_objects;
@@ -6288,8 +6288,9 @@ gc_stat_internal(VALUE hash_or_sym) https://github.com/ruby/ruby/blob/trunk/gc.c#L6288
 	S(heap_used);
 	S(heap_sorted_length);
 	S(heap_allocatable_pages);
-	S(heap_live_slot);
-	S(heap_free_slot);
+	S(heap_available_slots);
+	S(heap_live_slots);
+	S(heap_free_slots);
 	S(heap_final_slots);
 	S(heap_marked_slots);
 	S(heap_swept_slots);
@@ -6334,8 +6335,9 @@ gc_stat_internal(VALUE hash_or_sym) https://github.com/ruby/ruby/blob/trunk/gc.c#L6335
     SET(heap_used, heap_allocated_pages);
     SET(heap_sorted_length, heap_pages_sorted_length);
     SET(heap_allocatable_pages, heap_allocatable_pages);
-    SET(heap_live_slot, objspace_live_slot(objspace));
-    SET(heap_free_slot, objspace_free_slot(objspace));
+    SET(heap_available_slots, objspace_available_slots(objspace));
+    SET(heap_live_slots, objspace_live_slots(objspace));
+    SET(heap_free_slots, objspace_free_slots(objspace));
     SET(heap_final_slots, heap_pages_final_slots);
     SET(heap_marked_slots, objspace->marked_slots);
     SET(heap_swept_slots, heap_pages_swept_slots);

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

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