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

ruby-changes:32236

From: nagachika <ko1@a...>
Date: Sat, 21 Dec 2013 15:47:24 +0900 (JST)
Subject: [ruby-changes:32236] nagachika:r44315 (ruby_2_0_0): merge revision(s) 41759, 41760, 43356, 43460, 43677:

nagachika	2013-12-21 15:47:16 +0900 (Sat, 21 Dec 2013)

  New Revision: 44315

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

  Log:
    merge revision(s) 41759,41760,43356,43460,43677:
    
    * ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
      VC6.  only InterlockedCompareExchange is declared using PVOID.
    
    * ruby_atomic.h (rb_w32_atomic_cas): call InterlockedCompareExchange
      directly.
    
    * ruby_atomic.h (ATOMIC_CAS): fix missing function call.
    
    * ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
    
    * ruby_atomic.h (ATOMIC_SIZE_CAS): fix compile error on Solaris
      since r43460.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/ruby_atomic.h
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 44314)
+++ ruby_2_0_0/ChangeLog	(revision 44315)
@@ -1,3 +1,24 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sat Dec 21 15:37:11 2013  Naohisa Goto  <ngotogenome@g...>
+
+	* ruby_atomic.h (ATOMIC_SIZE_CAS): fix compile error on Solaris
+	  since r43460.
+
+Sat Dec 21 15:37:11 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby_atomic.h (ATOMIC_SIZE_CAS): new macro, compare and swap size_t.
+
+Sat Dec 21 15:37:11 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby_atomic.h (rb_w32_atomic_cas): call InterlockedCompareExchange
+	  directly.
+
+	* ruby_atomic.h (ATOMIC_CAS): fix missing function call.
+
+Sat Dec 21 15:37:11 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby_atomic.h (ATOMIC_CAS): suppress C4022 and C4047 warnings in
+	  VC6.  only InterlockedCompareExchange is declared using PVOID.
+
 Sat Dec 21 14:54:37 2013  CHIKANAGA Tomoyuki  <nagachika@r...>
 
 	* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of
Index: ruby_2_0_0/ruby_atomic.h
===================================================================
--- ruby_2_0_0/ruby_atomic.h	(revision 44314)
+++ ruby_2_0_0/ruby_atomic.h	(revision 44315)
@@ -50,15 +50,25 @@ rb_w32_atomic_or(volatile rb_atomic_t *v https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L50
 #endif
 # define ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val))
 # define ATOMIC_CAS(var, oldval, newval) InterlockedCompareExchange(&(var), (newval), (oldval))
+# if defined _MSC_VER && _MSC_VER <= 1200
+static inline rb_atomic_t
+rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t newval)
+{
+    return (rb_atomic_t)InterlockedCompareExchange((PVOID *)var, (PVOID)newval, (PVOID)oldval);
+}
+#   undef ATOMIC_CAS
+#   define ATOMIC_CAS(var, oldval, newval) rb_w32_atomic_cas(&(var), (oldval), (newval))
+# endif
 # ifdef _M_AMD64
-#  define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64(&(var), (val))
-#  define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64(&(var), -(val))
+#  define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), (val))
+#  define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), -(LONG)(val))
 #  define ATOMIC_SIZE_INC(var) InterlockedIncrement64(&(var))
 #  define ATOMIC_SIZE_DEC(var) InterlockedDecrement64(&(var))
 #  define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange64(&(var), (val))
+#  define ATOMIC_SIZE_CAS(var, oldval, val) InterlockedCompareExchange64(&(var), (oldval), (val))
 # else
 #  define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
-#  define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(val))
+#  define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))
 #  define ATOMIC_SIZE_INC(var) InterlockedIncrement((LONG *)&(var))
 #  define ATOMIC_SIZE_DEC(var) InterlockedDecrement((LONG *)&(var))
 #  define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange((LONG *)&(var), (val))
@@ -81,6 +91,7 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L91
 #  define ATOMIC_SIZE_INC(var) atomic_inc_ulong(&(var))
 #  define ATOMIC_SIZE_DEC(var) atomic_dec_ulong(&(var))
 #  define ATOMIC_SIZE_EXCHANGE(var, val) atomic_swap_ulong(&(var), (val))
+#  define ATOMIC_SIZE_CAS(var, oldval, val) atomic_cas_ulong(&(var), (oldval), (val))
 # else
 #  define ATOMIC_SIZE_ADD(var, val) atomic_add_int(&(var), (val))
 #  define ATOMIC_SIZE_SUB(var, val) atomic_add_int(&(var), -(val))
@@ -118,4 +129,8 @@ atomic_size_exchange(size_t *ptr, size_t https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L129
 }
 #endif
 
+#ifndef ATOMIC_SIZE_CAS
+# define ATOMIC_SIZE_CAS(var, oldval, val) ATOMIC_CAS(var, oldval, val)
+#endif
+
 #endif /* RUBY_ATOMIC_H */
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 44314)
+++ ruby_2_0_0/version.h	(revision 44315)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-12-21"
-#define RUBY_PATCHLEVEL 361
+#define RUBY_PATCHLEVEL 362
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 12

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r41759-41760,43356,43460,43677


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

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