ruby/test/ripper
Peter Zhu 584559d86a Fix leak of token_info when Ripper#warn jumps
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
2024-08-07 09:14:14 -04:00
..
assert_parse_files.rb Remove --disable-gems for assert_separately 2023-08-03 09:11:08 +09:00
dummyparser.rb test/ripper: nest helper classes under TestRipper module 2023-11-02 15:10:50 +09:00
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 [Bug #20579] ripper: Dispatch spaces at END-OF-INPUT without newline 2024-06-14 17:54:02 +09:00
test_parser_events.rb Fix leak of token_info when Ripper#warn jumps 2024-08-07 09:14:14 -04:00
test_ripper.rb Fix memory leak in Ripper.sexp 2024-05-01 11:09:54 -04:00
test_scanner_events.rb [Bug #20649] Allow `nil` as 2nd argument of `assign_error` 2024-07-24 22:18:36 +09:00
test_sexp.rb Fix segv when parsing `command` by ripper 2024-04-11 10:28:58 +09:00