summaryrefslogtreecommitdiff
path: root/ext/-test-
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-05 04:26:04 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-05 04:26:04 +0000
commit393b9e65e91036743609e0d5ed899072b0f2d0a8 (patch)
tree0d8d8c358b852e73e3f9dcd9eeefb057c4cd36bc /ext/-test-
parentfb29aefc7abe3fe1b2c7794035a73f9ba50e8364 (diff)
gc.c: split GC_END event into GC_END_MARK and GC_END_SWEEP
* include/ruby/ruby.h: remove INTERNAL_EVENT_GC_END and replace with two new events: GC_END_MARK and GC_END_SWEEP * gc.c (gc_after_sweep): emit GC_END_SWEEP after lazy sweep is done * gc.c (gc_marks_body): emit GC_END_MARK at end of minor/major mark * ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): tests for new events. * test/-ext-/tracepoint/test_tracepoint.rb (class TestTracepointObj): ditto. * NEWS: remove ObjectSpace.after_gc_*_hook. These are only a sample, and will be removed before ruby 2.1. * ext/objspace/gc_hook.c: remove ObjectSpace.after_gc_end_hook= git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-')
-rw-r--r--ext/-test-/tracepoint/tracepoint.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ext/-test-/tracepoint/tracepoint.c b/ext/-test-/tracepoint/tracepoint.c
index ebe2996..208bf57 100644
--- a/ext/-test-/tracepoint/tracepoint.c
+++ b/ext/-test-/tracepoint/tracepoint.c
@@ -5,7 +5,8 @@ struct tracepoint_track {
size_t newobj_count;
size_t free_count;
size_t gc_start_count;
- size_t gc_end_count;
+ size_t gc_end_mark_count;
+ size_t gc_end_sweep_count;
size_t objects_count;
VALUE objects[10];
};
@@ -37,9 +38,14 @@ tracepoint_track_objspace_events_i(VALUE tpval, void *data)
track->gc_start_count++;
break;
}
- case RUBY_INTERNAL_EVENT_GC_END:
+ case RUBY_INTERNAL_EVENT_GC_END_MARK:
{
- track->gc_end_count++;
+ track->gc_end_mark_count++;
+ break;
+ }
+ case RUBY_INTERNAL_EVENT_GC_END_SWEEP:
+ {
+ track->gc_end_sweep_count++;
break;
}
default:
@@ -52,7 +58,8 @@ tracepoint_track_objspace_events(VALUE self)
{
struct tracepoint_track track = {0, 0, 0, 0, 0,};
VALUE tpval = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_NEWOBJ | RUBY_INTERNAL_EVENT_FREEOBJ |
- RUBY_INTERNAL_EVENT_GC_START | RUBY_INTERNAL_EVENT_GC_END,
+ RUBY_INTERNAL_EVENT_GC_START | RUBY_INTERNAL_EVENT_GC_END_MARK |
+ RUBY_INTERNAL_EVENT_GC_END_SWEEP,
tracepoint_track_objspace_events_i, &track);
VALUE result = rb_ary_new();
@@ -63,7 +70,8 @@ tracepoint_track_objspace_events(VALUE self)
rb_ary_push(result, SIZET2NUM(track.newobj_count));
rb_ary_push(result, SIZET2NUM(track.free_count));
rb_ary_push(result, SIZET2NUM(track.gc_start_count));
- rb_ary_push(result, SIZET2NUM(track.gc_end_count));
+ rb_ary_push(result, SIZET2NUM(track.gc_end_mark_count));
+ rb_ary_push(result, SIZET2NUM(track.gc_end_sweep_count));
rb_ary_cat(result, track.objects, track.objects_count);
return result;