<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/re.c, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Fix links to syntax/literals.rdoc</title>
<updated>2024-12-15T06:36:08+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan.lo@shopify.com</email>
</author>
<published>2024-12-14T19:10:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=730731cc86d1cf87a3478ffc242d52c70eda2e42'/>
<id>730731cc86d1cf87a3478ffc242d52c70eda2e42</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Regexp.last_match returns `$~`, not `$!`</title>
<updated>2024-08-09T20:02:36+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2024-08-09T20:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a570421a5a773945aa8f9497b5d64bac809a196'/>
<id>5a570421a5a773945aa8f9497b5d64bac809a196</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory leak in String#start_with? when regexp times out</title>
<updated>2024-07-26T12:42:38+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-07-25T19:28:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7464514ca5e825ada31522b63a33e02d62a0a248'/>
<id>7464514ca5e825ada31522b63a33e02d62a0a248</id>
<content type='text'>
[Bug #20653]

This commit refactors how Onigmo handles timeout. Instead of raising a
timeout error, onig_search will return a ONIGERR_TIMEOUT which the
caller can free memory, and then raise a timeout error.

This fixes a memory leak in String#start_with when the regexp times out.
For example:

    regex = Regexp.new("^#{"(a*)" * 10_000}x$", timeout: 0.000001)
    str = "a" * 1000000 + "x"

    10.times do
      100.times do
        str.start_with?(regex)
      rescue
      end

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

Before:

    33216
    51936
    71152
    81728
    97152
    103248
    120384
    133392
    133520
    133616

After:

    14912
    15376
    15824
    15824
    16128
    16128
    16144
    16144
    16160
    16160
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20653]

This commit refactors how Onigmo handles timeout. Instead of raising a
timeout error, onig_search will return a ONIGERR_TIMEOUT which the
caller can free memory, and then raise a timeout error.

This fixes a memory leak in String#start_with when the regexp times out.
For example:

    regex = Regexp.new("^#{"(a*)" * 10_000}x$", timeout: 0.000001)
    str = "a" * 1000000 + "x"

    10.times do
      100.times do
        str.start_with?(regex)
      rescue
      end

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

Before:

    33216
    51936
    71152
    81728
    97152
    103248
    120384
    133392
    133520
    133616

After:

    14912
    15376
    15824
    15824
    16128
    16128
    16144
    16144
    16160
    16160
</pre>
</div>
</content>
</entry>
<entry>
<title>Add MatchData#bytebegin and MatchData#byteend</title>
<updated>2024-07-16T05:48:06+00:00</updated>
<author>
<name>Shugo Maeda</name>
<email>shugo@ruby-lang.org</email>
</author>
<published>2024-06-12T02:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e048a073a3cba04576b8f6a1673c283e4e20cd90'/>
<id>e048a073a3cba04576b8f6a1673c283e4e20cd90</id>
<content type='text'>
These methods return the byte-based offset of the beginning or end of the specified match.

[Feature #20576]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These methods return the byte-based offset of the beginning or end of the specified match.

[Feature #20576]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a hint of `ASCII-8BIT` being `BINARY`</title>
<updated>2024-04-18T08:17:26+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2024-02-19T12:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3a7846b1aa4c10d86dc5a91c6df94f89d60bb0c3'/>
<id>3a7846b1aa4c10d86dc5a91c6df94f89d60bb0c3</id>
<content type='text'>
[Feature #18576]

Since outright renaming `ASCII-8BIT` is deemed to backward incompatible,
the next best thing would be to only change its `#inspect`, particularly
in exception messages.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #18576]

Since outright renaming `ASCII-8BIT` is deemed to backward incompatible,
the next best thing would be to only change its `#inspect`, particularly
in exception messages.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory leak in OnigRegion when match raises</title>
<updated>2024-02-02T15:39:42+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-01-30T19:16:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01bfd1a2bf013a9ed92a9722ac5228187e05e6a8'/>
<id>01bfd1a2bf013a9ed92a9722ac5228187e05e6a8</id>
<content type='text'>
[Bug #20228]

rb_reg_onig_match can raise a Regexp::TimeoutError, which would cause
the OnigRegion to leak.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20228]

rb_reg_onig_match can raise a Regexp::TimeoutError, which would cause
the OnigRegion to leak.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory leak in stk_base when Regexp timeout</title>
<updated>2024-02-02T15:39:42+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-01-30T19:15:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1c120efe02d079b0a1dea573cf0fd7978d9cc857'/>
<id>1c120efe02d079b0a1dea573cf0fd7978d9cc857</id>
<content type='text'>
[Bug #20228]

If rb_reg_check_timeout raises a Regexp::TimeoutError, then the stk_base
will leak.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20228]

If rb_reg_check_timeout raises a Regexp::TimeoutError, then the stk_base
will leak.
</pre>
</div>
</content>
</entry>
<entry>
<title>* expand tabs. [ci skip]</title>
<updated>2024-01-07T15:50:59+00:00</updated>
<author>
<name>git</name>
<email>svn-admin@ruby-lang.org</email>
</author>
<published>2024-01-07T15:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b6167c25210d3022310009f091cf468dd527e62'/>
<id>5b6167c25210d3022310009f091cf468dd527e62</id>
<content type='text'>
Please consider using misc/expand_tabs.rb as a pre-commit hook.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Please consider using misc/expand_tabs.rb as a pre-commit hook.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust styles and indents [ci skip]</title>
<updated>2024-01-07T15:50:41+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-01-07T15:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c30b8ae947e4e0e01df74b07282b27b1b1c70df8'/>
<id>c30b8ae947e4e0e01df74b07282b27b1b1c70df8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't create T_MATCH object if /regexp/.match(string) doesn't match</title>
<updated>2024-01-01T21:28:26+00:00</updated>
<author>
<name>Luke Gruber</name>
<email>luke.gru@gmail.com</email>
</author>
<published>2023-12-30T18:26:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e12d4c654e3cb7a4473014610bc3bae41aaf811e'/>
<id>e12d4c654e3cb7a4473014610bc3bae41aaf811e</id>
<content type='text'>
Fixes [Bug #20104]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #20104]
</pre>
</div>
</content>
</entry>
</feed>
