[前][次][番号順一覧][スレッド一覧]

ruby-changes:37505

From: mame <ko1@a...>
Date: Fri, 13 Feb 2015 22:07:10 +0900 (JST)
Subject: [ruby-changes:37505] mame:r49586 (trunk): * string.c (str_discard): does not free for STR_NOFREE string.

mame	2015-02-13 22:06:58 +0900 (Fri, 13 Feb 2015)

  New Revision: 49586

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49586

  Log:
    * string.c (str_discard): does not free for STR_NOFREE string.
      [Bug #10853][ruby-core:68110]
    
    * bootstraptest/test_string.rb: test for above.

  Added files:
    trunk/bootstraptest/test_string.rb
  Modified files:
    trunk/ChangeLog
    trunk/string.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49585)
+++ ChangeLog	(revision 49586)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Feb 13 21:52:05 2015  Yusuke Endoh  <mame@t...>
+
+	* string.c (str_discard): does not free for STR_NOFREE string.
+	  [Bug #10853][ruby-core:68110]
+
+	* bootstraptest/test_string.rb: test for above.
+
 Fri Feb 13 21:16:00 2015  Yusuke Endoh  <mame@t...>
 
 	* lib/base64.rb: make urlsafe mode user-friendly.
Index: bootstraptest/test_string.rb
===================================================================
--- bootstraptest/test_string.rb	(revision 0)
+++ bootstraptest/test_string.rb	(revision 49586)
@@ -0,0 +1,3 @@ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_string.rb#L1
+assert_normal_exit %q{
+  inspect.clear
+}, '[ruby-core:68110]'
Index: string.c
===================================================================
--- string.c	(revision 49585)
+++ string.c	(revision 49586)
@@ -1662,7 +1662,7 @@ static inline void https://github.com/ruby/ruby/blob/trunk/string.c#L1662
 str_discard(VALUE str)
 {
     str_modifiable(str);
-    if (!STR_SHARED_P(str) && !STR_EMBED_P(str)) {
+    if (!STR_EMBED_P(str) && !FL_TEST(str, STR_SHARED|STR_NOFREE)) {
 	ruby_sized_xfree(STR_HEAP_PTR(str), STR_HEAP_SIZE(str));
 	RSTRING(str)->as.heap.ptr = 0;
 	RSTRING(str)->as.heap.len = 0;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]