From f48be9d73b4472570d28bf381d84e40cf65694c8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Nov 2018 03:59:39 -0800 Subject: Remove the pointer-specific atomic exchange macros --- common/atomic.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'common') diff --git a/common/atomic.h b/common/atomic.h index 5838f8da..dbb75d29 100644 --- a/common/atomic.h +++ b/common/atomic.h @@ -61,14 +61,6 @@ using std::atomic_thread_fence; #define ATOMIC_THREAD_FENCE atomic_thread_fence -/* If no PTR xchg variants are provided, the normal ones can handle it. */ -#ifndef ATOMIC_EXCHANGE_PTR -#define ATOMIC_EXCHANGE_PTR ATOMIC_EXCHANGE -#define ATOMIC_COMPARE_EXCHANGE_PTR_STRONG ATOMIC_COMPARE_EXCHANGE_STRONG -#define ATOMIC_COMPARE_EXCHANGE_PTR_WEAK ATOMIC_COMPARE_EXCHANGE_WEAK -#endif - - #define ATOMIC_LOAD_SEQ(_val) ATOMIC_LOAD(_val, almemory_order_seq_cst) #define ATOMIC_STORE_SEQ(_val, _newval) ATOMIC_STORE(_val, _newval, almemory_order_seq_cst) @@ -81,12 +73,6 @@ using std::atomic_thread_fence; #define ATOMIC_COMPARE_EXCHANGE_WEAK_SEQ(_val, _oldval, _newval) \ ATOMIC_COMPARE_EXCHANGE_WEAK(_val, _oldval, _newval, almemory_order_seq_cst, almemory_order_seq_cst) -#define ATOMIC_EXCHANGE_PTR_SEQ(_val, _newval) ATOMIC_EXCHANGE_PTR(_val, _newval, almemory_order_seq_cst) -#define ATOMIC_COMPARE_EXCHANGE_PTR_STRONG_SEQ(_val, _oldval, _newval) \ - ATOMIC_COMPARE_EXCHANGE_PTR_STRONG(_val, _oldval, _newval, almemory_order_seq_cst, almemory_order_seq_cst) -#define ATOMIC_COMPARE_EXCHANGE_PTR_WEAK_SEQ(_val, _oldval, _newval) \ - ATOMIC_COMPARE_EXCHANGE_PTR_WEAK(_val, _oldval, _newval, almemory_order_seq_cst, almemory_order_seq_cst) - typedef unsigned int uint; typedef ATOMIC(uint) RefCount; @@ -109,7 +95,7 @@ inline uint DecrementRef(RefCount *ptr) T _first = ATOMIC_LOAD(_head, almemory_order_acquire); \ do { \ ATOMIC_STORE(&(_entry)->next, _first, almemory_order_relaxed); \ - } while(ATOMIC_COMPARE_EXCHANGE_PTR_WEAK(_head, &_first, _entry, \ + } while(ATOMIC_COMPARE_EXCHANGE_WEAK(_head, &_first, _entry, \ almemory_order_acq_rel, almemory_order_acquire) == 0); \ } while(0) -- cgit v1.2.3