diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-12 02:36:28 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-12 02:36:28 +0000 |
commit | 9f67424dc97e2b99d98b71d08178681f0240ee86 (patch) | |
tree | 025a9cac2ba5d11a00f68cba650fdefe933844d2 /test | |
parent | 97acdd71435d062541510ba68fe6a33e7431e8a1 (diff) |
merge revision(s) 46501,47372,47460: [Backport #10191]
* object.c (rb_obj_copy_ivar): extract function to copy instance
variables only for T_OBJECT from init_copy.
* object.c (rb_obj_copy_ivar): allocate no memory for empty
instance variables. [ruby-core:64700] [Bug #10191]
* test/ruby/test_object.rb: extend timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_object.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 3bb07dd1b0..11fa1acc02 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -898,4 +898,14 @@ class TestObject < Test::Unit::TestCase err = assert_raise(TypeError){ [].first([42]) } assert_equal 'no implicit conversion of Array into Integer', err.message, issue end + + def test_copied_ivar_memory_leak + bug10191 = '[ruby-core:64700] [Bug #10191]' + assert_no_memory_leak([], <<-"end;", <<-"end;", bug10191, rss: true, timeout: 60) + def (a = Object.new).set; @v = nil; end + num = 500_000 + end; + num.times {a.clone.set} + end; + end end |