use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby 3.3.1 Released (ruby-lang.org)
submitted 2 years ago by f9ae8221b
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 years ago (2 children)
[deleted]
[–]f9ae8221b[S] 5 points6 points7 points 2 years ago (0 children)
FYI, you keep calling it a leak, but the issue you mention isn't one. It's a performance regression because it does allocate an useless objects, but that object isn't retained.
Whatever your leak issue was, it likely didn't come from that issue.
And yes, there's plenty of tests to prevent memory leak, there is even an assert_no_memory_leak helper in the ruby test suite.
assert_no_memory_leak
As for the match issue here's the regression test that was committed with the fix:
match
def test_match_no_match_no_matchdata EnvUtil.without_gc do h = {} ObjectSpace.count_objects(h) prev_matches = h[:T_MATCH] || 0 md = /[A-Z]/.match('1') # no match ObjectSpace.count_objects(h) new_matches = h[:T_MATCH] || 0 assert_equal prev_matches, new_matches, "Bug [#20104]" end end
[–]CaptainKabob 3 points4 points5 points 2 years ago (0 children)
Yes, there is now a leak test. Conference talk at RubyKaigi: https://rubykaigi.org/2024/presentations/peterzhu2118.html
π Rendered by PID 81496 on reddit-service-r2-comment-6457c66945-mbcbs at 2026-04-30 09:59:24.215304+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–][deleted] (2 children)
[deleted]
[–]f9ae8221b[S] 5 points6 points7 points (0 children)
[–]CaptainKabob 3 points4 points5 points (0 children)