summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-07-16 07:24:50 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-16 07:24:50 -0700
commitbea0ac1d8703091294fe5822d982591c849b5458 (patch)
tree1d7b20d187c218c9113de06d9c295ed9039f18af /include
parent55c4ce6885b577e2b29a4de674d4062a6882afe8 (diff)
downloadglibc-bea0ac1d8703091294fe5822d982591c849b5458.tar.gz
glibc-bea0ac1d8703091294fe5822d982591c849b5458.tar.xz
glibc-bea0ac1d8703091294fe5822d982591c849b5458.zip
Use rel semantics of cas instead of acq semantics with full barrier before it in _int_free
The following patch fixes catomic_compare_and_exchange_*_rel definitions
(which were never used and weren't correct) and uses
catomic_compare_and_exchange_val_rel in _int_free.  Comparing to the
pre-2009-07-02 --enable-experimental-malloc state the generated code should
be identical on all arches other than ppc/ppc64 and on ppc/ppc64 should use
lwsync instead of isync barrier.
Diffstat (limited to 'include')
-rw-r--r--include/atomic.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/include/atomic.h b/include/atomic.h
index 9366f78734..37d0111d5f 100644
--- a/include/atomic.h
+++ b/include/atomic.h
@@ -107,14 +107,19 @@
 #endif
 
 
-#ifndef atomic_compare_and_exchange_val_rel
-# define atomic_compare_and_exchange_val_rel(mem, newval, oldval)	      \
-  atomic_compare_and_exchange_val_acq (mem, newval, oldval)
+#ifndef catomic_compare_and_exchange_val_rel
+# ifndef atomic_compare_and_exchange_val_rel
+#  define catomic_compare_and_exchange_val_rel(mem, newval, oldval)	      \
+  catomic_compare_and_exchange_val_acq (mem, newval, oldval)
+# else
+#  define catomic_compare_and_exchange_val_rel(mem, newval, oldval)	      \
+  atomic_compare_and_exchange_val_rel (mem, newval, oldval)
+# endif
 #endif
 
 
-#ifndef catomic_compare_and_exchange_val_rel
-# define catomic_compare_and_exchange_val_rel(mem, newval, oldval)	      \
+#ifndef atomic_compare_and_exchange_val_rel
+# define atomic_compare_and_exchange_val_rel(mem, newval, oldval)	      \
   atomic_compare_and_exchange_val_acq (mem, newval, oldval)
 #endif
 
@@ -155,15 +160,20 @@
 #endif
 
 
-#ifndef atomic_compare_and_exchange_bool_rel
-# define atomic_compare_and_exchange_bool_rel(mem, newval, oldval) \
-  atomic_compare_and_exchange_bool_acq (mem, newval, oldval)
+#ifndef catomic_compare_and_exchange_bool_rel
+# ifndef atomic_compare_and_exchange_bool_rel
+#  define catomic_compare_and_exchange_bool_rel(mem, newval, oldval)	      \
+  catomic_compare_and_exchange_bool_acq (mem, newval, oldval)
+# else
+#  define catomic_compare_and_exchange_bool_rel(mem, newval, oldval)	      \
+  atomic_compare_and_exchange_bool_rel (mem, newval, oldval)
+# endif
 #endif
 
 
-#ifndef catomic_compare_and_exchange_bool_rel
-# define catomic_compare_and_exchange_bool_rel(mem, newval, oldval) \
-  catomic_compare_and_exchange_bool_acq (mem, newval, oldval)
+#ifndef atomic_compare_and_exchange_bool_rel
+# define atomic_compare_and_exchange_bool_rel(mem, newval, oldval) \
+  atomic_compare_and_exchange_bool_acq (mem, newval, oldval)
 #endif