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

ruby-changes:29083

From: naruse <ko1@a...>
Date: Fri, 7 Jun 2013 13:45:40 +0900 (JST)
Subject: [ruby-changes:29083] naruse:r41135 (trunk): * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of

naruse	2013-06-07 13:45:16 +0900 (Fri, 07 Jun 2013)

  New Revision: 41135

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

  Log:
    * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
      RB_GC_GUARD. it should be after the object is used.

  Modified files:
    trunk/ChangeLog
    trunk/ext/json/fbuffer/fbuffer.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41134)
+++ ChangeLog	(revision 41135)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun  7 13:25:27 2013  NARUSE, Yui  <naruse@r...>
+
+	* ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
+	  RB_GC_GUARD. it should be after the object is used.
+
 Fri Jun  7 13:22:43 2013  NARUSE, Yui  <naruse@r...>
 
 	* gc.c (before_gc_sweep): noinline can also avoid the segv instead of
Index: ext/json/fbuffer/fbuffer.h
===================================================================
--- ext/json/fbuffer/fbuffer.h	(revision 41134)
+++ ext/json/fbuffer/fbuffer.h	(revision 41135)
@@ -117,9 +117,9 @@ static void fbuffer_append_str(FBuffer * https://github.com/ruby/ruby/blob/trunk/ext/json/fbuffer/fbuffer.h#L117
     const char *newstr = StringValuePtr(str);
     unsigned long len = RSTRING_LEN(str);
 
-    RB_GC_GUARD(str);
-
     fbuffer_append(fb, newstr, len);
+
+    RB_GC_GUARD(str);
 }
 #endif
 

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

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