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

ruby-changes:18745

From: naruse <ko1@a...>
Date: Thu, 3 Feb 2011 18:36:02 +0900 (JST)
Subject: [ruby-changes:18745] Ruby:r30772 (trunk): * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared

naruse	2011-02-03 18:35:55 +0900 (Thu, 03 Feb 2011)

  New Revision: 30772

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

  Log:
    * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared
      because gz->z.input is hidden string. [ruby-core:35057]

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30771)
+++ ChangeLog	(revision 30772)
@@ -1,6 +1,12 @@
+Thu Feb  3 18:33:26 2011  NARUSE, Yui  <naruse@r...>
+
+	* ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared
+	  because gz->z.input is hidden string. [ruby-core:35057]
+
 Thu Feb  3 16:34:10 2011  NARUSE, Yui  <naruse@r...>
 
-	* enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of pointers.
+	* enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of
+	  pointers.
 
 	* enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t.
 
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 30771)
+++ ext/zlib/zlib.c	(revision 30772)
@@ -2471,7 +2471,7 @@
     }
     if (NIL_P(gz->z.input)) return Qnil;
 
-    str = rb_str_dup(gz->z.input);
+    str = rb_str_new_shared(gz->z.input);
     OBJ_TAINT(str);  /* for safe */
     return str;
 }

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

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