summaryrefslogtreecommitdiff
path: root/test/-ext-/string
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-17 02:58:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-17 02:58:37 +0000
commit26fa27fe12cab1c9af8401399dba811b6f52803b (patch)
tree461981be93d0b4c1a43375fc97a58e9024765dd9 /test/-ext-/string
parent982a9d8e91a0de6abd2af3d888aba1aa2880103c (diff)
string.c: clear NOFREE flag at embedding
* string.c (STR_SET_EMBED): clear NOFREE flag at embedding as embedded strings no longer refer static strings. [ruby-core:68436] [Bug #10942] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/string')
-rw-r--r--test/-ext-/string/test_nofree.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/-ext-/string/test_nofree.rb b/test/-ext-/string/test_nofree.rb
new file mode 100644
index 0000000..cbaabb2
--- /dev/null
+++ b/test/-ext-/string/test_nofree.rb
@@ -0,0 +1,10 @@
+require 'test/unit'
+
+class Test_StringNoFree < Test::Unit::TestCase
+ def test_no_memory_leak
+ bug10942 = '[ruby-core:68436] [Bug #10942] no leak on nofree string'
+ assert_no_memory_leak(%w(-r-test-/string/string), '',
+ '1000000.times {Bug::String.nofree << "a" * 100}',
+ bug10942, rss: true)
+ end
+end