1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

use bind_call for test-all --gc-stress

This one allocation of Method object is worth avoiding.  We don't
want to test UnboundMethod#bind right here.  GC need not run.
This commit is contained in:
卜部昌平 2019-10-03 14:56:35 +09:00
parent 1c999952e7
commit 84fc1de512

View file

@ -938,7 +938,7 @@ module Test
define_method(:run) do |runner|
begin
gc_stress, GC.stress = GC.stress, true
oldrun.bind(self).call(runner)
oldrun.bind_call(self, runner)
ensure
GC.stress = gc_stress
end