ruby-changes:31061
From: tmm1 <ko1@a...>
Date: Fri, 4 Oct 2013 19:52:34 +0900 (JST)
Subject: [ruby-changes:31061] tmm1:r43140 (trunk): gc.c: rename heap.free_num to heap.swept_num
tmm1 2013-10-04 19:52:25 +0900 (Fri, 04 Oct 2013) New Revision: 43140 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43140 Log: gc.c: rename heap.free_num to heap.swept_num * gc.c: rename heap.free_num as heap.swept_num to clarify meaning and avoid confusion with objspace_free_num(). Modified files: trunk/ChangeLog trunk/gc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 43139) +++ ChangeLog (revision 43140) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Oct 4 19:49:42 2013 Aman Gupta <ruby@t...> + + * gc.c: rename heap.free_num as heap.swept_num to clarify meaning and + avoid confusion with objspace_free_num(). + Fri Oct 4 19:02:01 2013 Aman Gupta <ruby@t...> * gc.c (objspace_free_num): new method for available/free slots on Index: gc.c =================================================================== --- gc.c (revision 43139) +++ gc.c (revision 43140) @@ -335,7 +335,7 @@ typedef struct rb_objspace { https://github.com/ruby/ruby/blob/trunk/gc.c#L335 size_t used; size_t limit; RVALUE *range[2]; - size_t free_num; + size_t swept_num; size_t free_min; size_t final_num; size_t do_heap_free; @@ -1787,7 +1787,7 @@ finalize_list(rb_objspace_t *objspace, R https://github.com/ruby/ruby/blob/trunk/gc.c#L1787 objspace->total_freed_object_num++; if (!FL_TEST(p, FL_SINGLETON)) { /* not freeing page */ heap_slot_add_freeobj(objspace, GET_HEAP_SLOT(p), (VALUE)p); - objspace->heap.free_num++; + objspace->heap.swept_num++; } else { struct heap_slot *slot = (struct heap_slot *)(VALUE)RDATA(p)->dmark; @@ -2347,7 +2347,7 @@ gc_slot_sweep(rb_objspace_t *objspace, s https://github.com/ruby/ruby/blob/trunk/gc.c#L2347 #endif if (final_num + freed_num + empty_num == sweep_slot->limit && - objspace->heap.free_num > objspace->heap.do_heap_free) { + objspace->heap.swept_num > objspace->heap.do_heap_free) { RVALUE *pp; for (pp = deferred_final_list; pp != final; pp = pp->as.free.next) { @@ -2365,7 +2365,7 @@ gc_slot_sweep(rb_objspace_t *objspace, s https://github.com/ruby/ruby/blob/trunk/gc.c#L2365 else { sweep_slot->free_next = NULL; } - objspace->heap.free_num += freed_num + empty_num; + objspace->heap.swept_num += freed_num + empty_num; } objspace->total_freed_object_num += freed_num; objspace->heap.final_num += final_num; @@ -2397,7 +2397,7 @@ gc_before_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2397 } } objspace->heap.sweep_slots = heap_slots; - objspace->heap.free_num = 0; + objspace->heap.swept_num = 0; objspace->heap.free_slots = NULL; if (objspace->heap.using_slot) { @@ -2448,10 +2448,10 @@ gc_before_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2448 static void gc_after_sweep(rb_objspace_t *objspace) { - rgengc_report(1, objspace, "after_gc_sweep: objspace->heap.free_num: %d, objspace->heap.free_min: %d\n", - objspace->heap.free_num, objspace->heap.free_min); + rgengc_report(1, objspace, "after_gc_sweep: objspace->heap.swept_num: %d, objspace->heap.free_min: %d\n", + objspace->heap.swept_num, objspace->heap.free_min); - if (objspace->heap.free_num < objspace->heap.free_min) { + if (objspace->heap.swept_num < objspace->heap.free_min) { heap_set_increment(objspace); heap_increment(objspace); @@ -4153,7 +4153,7 @@ rb_gc_force_recycle(VALUE p) https://github.com/ruby/ruby/blob/trunk/gc.c#L4153 heap_slot_add_freeobj(objspace, GET_HEAP_SLOT(p), p); if (!MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(p), p)) { - objspace->heap.free_num++; + objspace->heap.swept_num++; } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/