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

ruby-changes:31916

From: nobu <ko1@a...>
Date: Thu, 5 Dec 2013 10:48:13 +0900 (JST)
Subject: [ruby-changes:31916] nobu:r43995 (trunk): ruby_atomic.h: duplicate code

nobu	2013-12-05 10:47:58 +0900 (Thu, 05 Dec 2013)

  New Revision: 43995

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

  Log:
    ruby_atomic.h: duplicate code
    
    * ruby_atomic.h (ATOMIC_SIZE_CAS): remove duplicate code as
      ATOMIC_CAS().

  Modified files:
    trunk/ruby_atomic.h
Index: ruby_atomic.h
===================================================================
--- ruby_atomic.h	(revision 43994)
+++ ruby_atomic.h	(revision 43995)
@@ -16,10 +16,6 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L16
 
 # 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_SIZE_CAS(var, oldval, newval) \
-({ size_t oldvaldup = (oldval); \
-   __atomic_compare_exchange_n(&(var), &oldvaldup, (newval), 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
-   oldvaldup; })
 
 #elif defined HAVE_GCC_SYNC_BUILTINS
 /* @shyouhei hack to support atomic operations in case of gcc. Gcc

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

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