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

ruby-changes:38604

From: normal <ko1@a...>
Date: Sat, 30 May 2015 17:19:55 +0900 (JST)
Subject: [ruby-changes:38604] normal:r50685 (trunk): ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile

normal	2015-05-30 17:19:37 +0900 (Sat, 30 May 2015)

  New Revision: 50685

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

  Log:
    ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
    
    See doc/extension.rdoc for explanation.
    
    [ruby-core:69419] [Feature #11198]

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/ancdata.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50684)
+++ ChangeLog	(revision 50685)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat May 30 16:12:35 2015  Eric Wong  <e@8...>
+
+	* ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
+	  [ruby-core:69419] [Feature #11198]
+
 Sat May 30 15:59:10 2015  NAKAMURA Usaku  <usa@r...>
 
 	* lib/tempfile.rb (Tempfile#initialize): initialize @unlinked to fix
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 50684)
+++ ext/socket/ancdata.c	(revision 50685)
@@ -1135,7 +1135,7 @@ bsock_sendmsg_internal(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/ext/socket/ancdata.c#L1135
     struct msghdr mh;
     struct iovec iov;
 #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
-    volatile VALUE controls_str = 0;
+    VALUE controls_str = 0;
     VALUE *controls_ptr = NULL;
     int family;
 #endif
@@ -1291,6 +1291,9 @@ bsock_sendmsg_internal(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/ext/socket/ancdata.c#L1291
             rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block");
 	rb_sys_fail("sendmsg(2)");
     }
+#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
+    RB_GC_GUARD(controls_str);
+#endif
 
     return SSIZET2NUM(ss);
 }

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

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