aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-18 03:59:39 -0800
committerChris Robinson <[email protected]>2018-11-18 03:59:39 -0800
commitf48be9d73b4472570d28bf381d84e40cf65694c8 (patch)
tree59a4b4a9c869beab928cf06a35d3592dc4c334d0 /common
parent7433cb5f4cb0515dd6e314978f579ae91e2c63c4 (diff)
Remove the pointer-specific atomic exchange macros
Diffstat (limited to 'common')
-rw-r--r--common/atomic.h16
1 files changed, 1 insertions, 15 deletions
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)