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

ruby-changes:33595

From: nobu <ko1@a...>
Date: Wed, 23 Apr 2014 11:03:39 +0900 (JST)
Subject: [ruby-changes:33595] nobu:r45676 (trunk): stringio.c: move GC guard

nobu	2014-04-23 11:03:35 +0900 (Wed, 23 Apr 2014)

  New Revision: 45676

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

  Log:
    stringio.c: move GC guard
    
    * ext/stringio/stringio.c (strio_write): move GC guard after the
      last using position.

  Modified files:
    trunk/ext/stringio/stringio.c
Index: ext/stringio/stringio.c
===================================================================
--- ext/stringio/stringio.c	(revision 45675)
+++ ext/stringio/stringio.c	(revision 45676)
@@ -1170,7 +1170,6 @@ strio_write(VALUE self, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1170
     long len, olen;
     rb_encoding *enc, *enc2;
 
-    RB_GC_GUARD(str);
     if (!RB_TYPE_P(str, T_STRING))
 	str = rb_obj_as_string(str);
     enc = rb_enc_get(ptr->string);
@@ -1194,6 +1193,7 @@ strio_write(VALUE self, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1193
 	OBJ_INFECT(ptr->string, str);
     }
     OBJ_INFECT(ptr->string, self);
+    RB_GC_GUARD(str);
     ptr->pos += len;
     return LONG2NUM(len);
 }

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

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