From: Eric Wong Date: 2017-06-09T07:40:25+00:00 Subject: [ruby-core:81630] Re: [Ruby trunk Feature#13637] [PATCH] tool/runruby.rb: test with smallest possible machine stack ko1@atdot.net wrote: > I missed this ticket. > I wonder there are no failures on CI. That is fortunate to hear :) > Do you mean that we shouldn't use recursive call which can increase machine stack on `Thread` and `Fiber` in our tests? > Now, we don't have such tests (so that we don't have failures/errors) but it is possible. We should reconsider our code and data structures before introducing recursion in code we control. > I agree that we should consider about machine stack size, but I'm not sure this approach is correct (at least now it seems no problem). Or if we need to introduce such recursive calls, we remove this restriction? If we really need to introduce recursion; we can use assert_separately to test it. However, we should avoid recursion if possible because of GC cost and potential portability + safety problems. Instead; we can redesign data structures and algorithms to avoid recursion (and maybe encourage Rubyists to do the same). Coincidentally, I (finally) announced msgthr earlier on ruby-talk; which makes non-recursive modifications to previously well-known recursive algorithm: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/437984 These were originally implemented in Perl5: Mail::Thread in CPAN: https://rt.cpan.org/Ticket/Display.html?id=116727 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833479 and public-inbox: https://public-inbox.org/meta/20160621031201.28089-1-e@80x24.org/t/ Unsubscribe: