1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/ruby.h, gc.c: add new internal event

RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
  after_sweep().
  Time chart with lazy sweep is here:
  (1) Kick RUBY_INTERNAL_EVENT_GC_START
  (2) [gc_marks()]
  (3) [lazy_sweep()]
  (4) [... run Ruby program (mutator) with lazy_sweep() ...]
  (5) [after_sweep()]
  (6) Kick RUBY_INTERNAL_EVENT_GC_END
  (7) [... run Ruby program (mutator), and go to (1) ...]
* ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: modify a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-05-27 15:40:27 +00:00
parent c5b6c189d2
commit e4c58251b7
5 changed files with 38 additions and 4 deletions

View file

@ -17,7 +17,7 @@ class TestTracepointObj < Test::Unit::TestCase
nil
}
newobj_count, free_count, gc_start_count, *newobjs = *result
newobj_count, free_count, gc_start_count, gc_end_count, *newobjs = *result
assert_equal 2, newobj_count
assert_equal 2, newobjs.size
assert_equal 'foobar', newobjs[0]
@ -31,10 +31,15 @@ class TestTracepointObj < Test::Unit::TestCase
}
GC.stat(stat2)
newobj_count, free_count, gc_start_count, *newobjs = *result
newobj_count, free_count, gc_start_count, gc_end_count, *newobjs = *result
assert_operator stat2[:total_allocated_object] - stat1[:total_allocated_object], :>=, newobj_count
assert_operator 1_000_000, :<=, newobj_count
assert_operator stat2[:total_freed_object] - stat1[:total_freed_object], :>=, free_count
assert_operator stat2[:count] - stat1[:count], :==, gc_start_count
assert_operator gc_start_count, :>=, gc_end_count
assert_operator stat2[:count] - stat1[:count] - 1, :<=, gc_end_count
end
end