summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 00:24:14 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 00:24:14 +0000
commitcaf923fa6a473918fa7a7a66aeb73495feaff833 (patch)
tree32a4693ecf80ab909ece2bec6f55b9bff036fcba /gc.c
parent4b18db6a2fc374b6ca17b6632b1340b382cce982 (diff)
* gc.c (slot_sweep_body): add counters at a time.
* gc.c (gc_profile_dump_on): fix line break position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/gc.c b/gc.c
index 1cc40c1ddc..99167db3df 100644
--- a/gc.c
+++ b/gc.c
@@ -2209,15 +2209,7 @@ slot_sweep_body(rb_objspace_t *objspace, struct heaps_slot *sweep_slot, const in
RVALUE *final = deferred_final_list;
int deferred;
bits_t *bits, bitset;
-#if GC_PROFILE_MORE_DETAIL
- gc_profile_record *record=NULL;
-#endif
-#if GC_PROFILE_MORE_DETAIL
- if (objspace->profile.run) {
- record = gc_prof_record(objspace);
- }
-#endif
rgengc_report(3, objspace, "slot_sweep_body: start.\n");
p = sweep_slot->header->start; pend = p + sweep_slot->header->limit;
@@ -2235,9 +2227,6 @@ slot_sweep_body(rb_objspace_t *objspace, struct heaps_slot *sweep_slot, const in
do {
if ((bitset & 1) && BUILTIN_TYPE(p) != T_ZOMBIE) {
if (p->as.basic.flags) {
-#if GC_PROFILE_MORE_DETAIL
- if(record) record->removing_objects++;
-#endif
rgengc_report(3, objspace, "slot_sweep_body: free %p (%s)\n", p, obj_type_name((VALUE)p));
#if USE_RGENGC && RGENGC_CHECK_MODE
if (objspace->rgengc.during_minor_gc && RVALUE_PROMOTED((VALUE)p)) rb_bug("slot_sweep_body: %p (%s) is promoted.\n", p, obj_type_name((VALUE)p));
@@ -2263,10 +2252,6 @@ slot_sweep_body(rb_objspace_t *objspace, struct heaps_slot *sweep_slot, const in
}
}
else {
-#if GC_PROFILE_MORE_DETAIL
- if(record)
- record->empty_objects++;
-#endif
empty_num++;
}
}
@@ -2275,12 +2260,22 @@ slot_sweep_body(rb_objspace_t *objspace, struct heaps_slot *sweep_slot, const in
} while (bitset);
}
}
+
#if USE_RGENGC
gc_setup_mark_bits(sweep_slot);
#else
gc_clear_slot_bits(sweep_slot);
#endif
+#if GC_PROFILE_MORE_DETAIL
+ if (objspace->profile.run) {
+ gc_profile_record *record = gc_prof_record(objspace);
+ record->removing_objects += final_num + freed_num;
+ record->empty_objects += empty_num;
+ }
+#endif
+
+
if (final_num + freed_num + empty_num == sweep_slot->header->limit &&
objspace->heap.free_num > objspace->heap.do_heap_free) {
RVALUE *pp;
@@ -5348,10 +5343,9 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
#endif
" %9"PRIuSIZE" %17.12f %17.12f %17.12f %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE
#if RGENGC_PROFILE
- "%10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE"\n"
+ "%10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE
#endif
- ,
-
+ "\n",
i+1,
(record->flags & GPR_FLAG_MINOR) ? '-' : '+',
(record->flags & GPR_FLAG_HAVE_FINALIZE) ? 'F' : '.',