summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-27 06:09:55 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-27 06:09:55 +0000
commit5993c141f1c457d45807c3338cdc268052ac2a4e (patch)
treef34326e36cc61fccd604013d2398b9c0c90a4378 /gc.c
parent53f3ddfefb4131c20baa7589d022f7ffb0859c6b (diff)
* gc.c (gc_stat): add new information heap_eden_page_length and
heap_tomb_page_length. * test/ruby/test_gc.rb: fix to use GC.stat[:heap_eden_page_length] instead of GC.stat[:heap_length]. This test expects `heap_eden_page_length' (used pages size). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 7ceb534072..0f10ceb933 100644
--- a/gc.c
+++ b/gc.c
@@ -2742,6 +2742,11 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
heap_pages_final_slots += final_slots;
sweep_page->final_slots = final_slots;
+ if (1) fprintf(stderr, "gc_page_sweep(%d): freed?: %d, limt: %d, freed_slots: %d, empty_slots: %d, final_slots: %d\n",
+ (int)rb_gc_count(),
+ final_slots + freed_slots + empty_slots == sweep_page->limit,
+ (int)sweep_page->limit, (int)freed_slots, (int)empty_slots, final_slots);
+
if (heap_pages_deferred_final && !finalizing) {
rb_thread_t *th = GET_THREAD();
if (th) {
@@ -5064,6 +5069,7 @@ gc_stat(int argc, VALUE *argv, VALUE self)
static VALUE sym_count;
static VALUE sym_heap_used, sym_heap_length, sym_heap_increment;
static VALUE sym_heap_live_slot, sym_heap_free_slot, sym_heap_final_slot, sym_heap_swept_slot;
+ static VALUE sym_heap_eden_page_length, sym_heap_tomb_page_length;
static VALUE sym_total_allocated_object, sym_total_freed_object;
static VALUE sym_malloc_increase, sym_malloc_limit;
#if USE_RGENGC
@@ -5090,6 +5096,8 @@ gc_stat(int argc, VALUE *argv, VALUE self)
S(heap_free_slot);
S(heap_final_slot);
S(heap_swept_slot);
+ S(heap_eden_page_length);
+ S(heap_tomb_page_length);
S(total_allocated_object);
S(total_freed_object);
S(malloc_increase);
@@ -5139,6 +5147,8 @@ gc_stat(int argc, VALUE *argv, VALUE self)
SET(heap_free_slot, objspace_free_slot(objspace));
SET(heap_final_slot, heap_pages_final_slots);
SET(heap_swept_slot, heap_pages_swept_slots);
+ SET(heap_eden_page_length, heap_eden->page_length);
+ SET(heap_tomb_page_length, heap_tomb->page_length);
SET(total_allocated_object, objspace->profile.total_allocated_object_num);
SET(total_freed_object, objspace->profile.total_freed_object_num);
SET(malloc_increase, malloc_increase);