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

ruby-changes:32238

From: nagachika <ko1@a...>
Date: Sat, 21 Dec 2013 16:16:24 +0900 (JST)
Subject: [ruby-changes:32238] nagachika:r44317 (ruby_2_0_0): merge revision(s) 43996:

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

  New Revision: 44317

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

  Log:
    merge revision(s) 43996:
    
    * ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for
      a generic pointer.

  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 44316)
+++ ruby_2_0_0/ChangeLog	(revision 44317)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sat Dec 21 16:07:00 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ruby_atomic.h (ATOMIC_PTR_EXCHANGE): atomic exchange function for
+	  a generic pointer.
+
 Sat Dec 21 15:50:13 2013  Masaki Matsushita  <glass.saga@g...>
 
 	* ruby_atomic.h: remove duplicate definisions between ATOMIC_XXX
Index: ruby_2_0_0/ruby_atomic.h
===================================================================
--- ruby_2_0_0/ruby_atomic.h	(revision 44316)
+++ ruby_2_0_0/ruby_atomic.h	(revision 44317)
@@ -17,6 +17,8 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L17
 # define ATOMIC_SIZE_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_SEQ_CST)
 # define ATOMIC_SIZE_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_SEQ_CST)
 
+# define ATOMIC_PTR_EXCHANGE(var, val) __atomic_exchange_n(&(var), (val), __ATOMIC_SEQ_CST)
+
 #elif defined HAVE_GCC_SYNC_BUILTINS
 /* @shyouhei hack to support atomic operations in case of gcc. Gcc
  * has its own pseudo-insns to support them.  See info, or
@@ -33,6 +35,8 @@ typedef unsigned int rb_atomic_t; /* Any https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L35
 # define ATOMIC_SIZE_ADD(var, val) __sync_fetch_and_add(&(var), (val))
 # define ATOMIC_SIZE_SUB(var, val) __sync_fetch_and_sub(&(var), (val))
 
+# define ATOMIC_PTR_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
+
 #elif defined _WIN32
 #if defined _MSC_VER && _MSC_VER > 1200
 #pragma intrinsic(_InterlockedOr)
@@ -152,4 +156,10 @@ atomic_size_exchange(size_t *ptr, size_t https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ruby_atomic.h#L156
 # define ATOMIC_SIZE_CAS(var, oldval, val) ATOMIC_CAS(var, oldval, val)
 #endif
 
+#ifndef ATOMIC_PTR_EXCHANGE
+# if SIZEOF_VOIDP == SIZEOF_SIZE_T
+#   define ATOMIC_PTR_EXCHANGE(var, val) (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val))
+# endif
+#endif
+
 #endif /* RUBY_ATOMIC_H */
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 44316)
+++ ruby_2_0_0/version.h	(revision 44317)
@@ -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 363
+#define RUBY_PATCHLEVEL 364
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 12

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r43996


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

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