[Fontconfig] fontconfig: Branch 'main'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Sep 6 03:17:10 UTC 2021
src/fcatomic.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 6e68763085b2a9003b3b5fab4ff6418a667124f2
Author: Ben Wagner <bungeman at chromium.org>
Date: Tue Aug 31 12:38:50 2021 -0400
Add memory order constraints to C11 atomics
Reduce the strength of the C11 atomics from memory_order_seq_cst to the
actually required memory order constraints for each operation. In
addition to reflecting the already documented memory order constraints,
this should allow for better code generation.
diff --git a/src/fcatomic.h b/src/fcatomic.h
index a41b0aa..3f4a9d3 100644
--- a/src/fcatomic.h
+++ b/src/fcatomic.h
@@ -57,11 +57,11 @@ typedef <type> fc_atomic_int_t;
typedef atomic_int fc_atomic_int_t;
#define FC_ATOMIC_INT_FORMAT "d"
-#define fc_atomic_int_add(AI, V) atomic_fetch_add (&(AI), (V))
+#define fc_atomic_int_add(AI, V) atomic_fetch_add_explicit (&(AI), (V), memory_order_acq_rel)
-#define fc_atomic_ptr_get(P) atomic_load ((_Atomic(void *)*) (P))
+#define fc_atomic_ptr_get(P) atomic_load_explicit ((_Atomic(void *)*) (P), memory_order_acquire)
static inline FcBool _fc_atomic_ptr_cmpexch(_Atomic(void *)*P, void * O, _Atomic(void *) N) {
- return atomic_compare_exchange_strong(P, &O, N);
+ return atomic_compare_exchange_strong_explicit(P, &O, N, memory_order_release, memory_order_relaxed);
}
#define fc_atomic_ptr_cmpexch(P,O,N) _fc_atomic_ptr_cmpexch ((_Atomic(void *)*) (P), (O), (N))
More information about the Fontconfig
mailing list