Peter Zhu 51ffef2819 Fix memory leak in prism when syntax error in iseq compilation
If there's a syntax error during iseq compilation then prism would leak
memory because it would not free the pm_parse_result_t.

This commit changes pm_iseq_new_with_opt to have a rb_protect to catch
when an error is raised, and return NULL and set error_state to a value
that can be raised by calling rb_jump_tag after memory has been freed.

For example:

    10.times do
      10_000.times do
        eval("/[/=~s")
      rescue SyntaxError
      end

      puts `ps -o rss= -p #{$$}`
    end

Before:

    39280
    68736
    99232
    128864
    158896
    188208
    217344
    246304
    275376
    304592

After:

    12192
    13200
    14256
    14848
    16000
    16000
    16000
    16064
    17232
    17952
2024-11-08 15:43:41 -05:00
2024-11-05 12:19:55 +01:00
2024-11-08 18:02:46 +09:00
2024-11-08 05:18:39 +00:00
2024-11-05 15:36:34 +00:00
2024-11-01 02:33:11 +09:00
2024-10-28 17:27:40 +09:00
2024-09-18 21:03:48 +09:00
2024-06-04 12:40:08 +09:00
2024-11-08 14:56:44 -05:00
2024-09-30 18:04:41 +09:00
2024-09-19 10:14:17 -07:00
2024-11-08 18:02:46 +09:00
2024-11-06 11:06:18 +09:00
2024-10-07 20:12:57 -04:00
2024-10-25 20:52:32 +09:00
2024-09-20 19:26:37 +09:00
2024-09-19 12:10:27 -04:00
2024-09-08 23:40:18 +09:00
GPL
2024-10-03 18:47:09 +09:00
2024-09-26 20:01:20 +09:00
2024-11-05 23:04:49 +09:00
2024-07-20 11:25:26 +09:00
2024-10-03 21:20:09 +01:00
2024-10-25 22:26:29 +09:00
2024-09-17 12:46:01 +09:00
2024-11-08 18:02:46 +09:00
2024-11-08 18:02:46 +09:00
2024-10-09 07:14:44 +09:00
2024-11-08 19:48:56 +09:00
2024-10-31 12:44:50 +09:00
2024-11-08 18:02:46 +09:00
2024-10-25 22:32:38 +09:00
2024-10-25 22:32:38 +09:00
2024-10-03 21:20:09 +01:00
2024-10-03 21:20:09 +01:00
2024-10-20 19:33:21 +09:00
2024-10-09 07:14:44 +09:00
2024-11-08 18:02:46 +09:00
2024-11-08 18:02:46 +09:00
2024-11-08 18:02:46 +09:00
2024-11-06 11:06:18 +09:00
2024-07-05 21:20:54 +09:00
2024-11-08 18:02:46 +09:00
2024-11-08 18:02:46 +09:00

Actions Status: MinGW Actions Status: RJIT Actions Status: Ubuntu Actions Status: Windows Travis Status

What is Ruby?

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, etc.) cf. https://docs.ruby-lang.org/en/master/maintainers_md.html#label-Platform+Maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

You can download release packages and the snapshot of the repository. If you want to download whole versions of Ruby, please visit https://www.ruby-lang.org/en/downloads/releases/.

Download with Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

How to build

See Building Ruby

Ruby home page

https://www.ruby-lang.org/

Documentation

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

join

in the mail subject (not body) to the address ruby-talk-request@ml.ruby-lang.org.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list or on websites like https://stackoverflow.com.

Bugs should be reported at https://bugs.ruby-lang.org. Read "Reporting Issues" for more information.

Contributing

See "Contributing to Ruby", which includes setup and build instructions.

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

Description
Languages
Ruby 58.9%
C 29.5%
Rust 6.1%
C++ 2.9%
Yacc 0.9%
Other 1.6%