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

ruby-changes:40813

From: nobu <ko1@a...>
Date: Sat, 5 Dec 2015 09:25:48 +0900 (JST)
Subject: [ruby-changes:40813] nobu:r52892 (trunk): ruby_atomic.h: fix the argument order

nobu	2015-12-05 09:25:43 +0900 (Sat, 05 Dec 2015)

  New Revision: 52892

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

  Log:
    ruby_atomic.h: fix the argument order
    
    * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
      InterlockedCompareExchange64.  new value and then old value is
      the last.

  Modified files:
    trunk/ChangeLog
    trunk/ruby_atomic.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52891)
+++ ChangeLog	(revision 52892)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec  5 09:25:41 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
+	  InterlockedCompareExchange64.  new value and then old value is
+	  the last.
+
 Sat Dec  5 09:23:34 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* random.c (fill_random_seed): fix the size to be filled, not the
Index: ruby_atomic.h
===================================================================
--- ruby_atomic.h	(revision 52891)
+++ ruby_atomic.h	(revision 52892)
@@ -81,7 +81,7 @@ rb_w32_atomic_cas(volatile rb_atomic_t * https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L81
 #  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))
+#  define ATOMIC_SIZE_CAS(var, oldval, newval) InterlockedCompareExchange64(&(var), (newval), (oldval))
 # else
 #  define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
 #  define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))

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

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