зеркало из https://github.com/github/ruby.git
584559d86a
For example, the following code leaks: class MyRipper < Ripper def initialize(src, &blk) super(src) @blk = blk end def warn(msg, *args) = @blk.call(msg) end $VERBOSE = true def call_parse = MyRipper.new("if true\n end\n") { |msg| return msg }.parse 10.times do 500_000.times do call_parse end puts `ps -o rss= -p #{$$}` end Before: 37536 53744 70064 86448 102576 119120 135248 151216 167744 183824 After: 19280 19696 19728 20336 20448 21408 21616 21616 21824 21840 |
||
---|---|---|
.. | ||
assert_parse_files.rb | ||
dummyparser.rb | ||
test_files_ext.rb | ||
test_files_lib.rb | ||
test_files_sample.rb | ||
test_files_test.rb | ||
test_files_test_1.rb | ||
test_files_test_2.rb | ||
test_filter.rb | ||
test_lexer.rb | ||
test_parser_events.rb | ||
test_ripper.rb | ||
test_scanner_events.rb | ||
test_sexp.rb |