libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 06/35] Remove unneeded `cmpxchg_ptr()' from inc


From: Tommi Rantala
Subject: [Libunwind-devel] [PATCH 06/35] Remove unneeded `cmpxchg_ptr()' from include/libunwind_i.h
Date: Tue, 18 Sep 2012 16:31:15 +0300

With the new `sos_alloc()' implementation in place, we no longer use
`cmpxchg_ptr()' anywhere.
---
 include/libunwind_i.h |   31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index 493cb12..acc6bbb 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -127,45 +127,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.  */
 
 #ifdef HAVE_ATOMIC_OPS_H
 # include <atomic_ops.h>
-static inline int
-cmpxchg_ptr (void *addr, void *old, void *new)
-{
-  union
-    {
-      void *vp;
-      AO_t *aop;
-    }
-  u;
-
-  u.vp = addr;
-  return AO_compare_and_swap(u.aop, (AO_t) old, (AO_t) new);
-}
 # define fetch_and_add1(_ptr)          AO_fetch_and_add1(_ptr)
 # define fetch_and_add(_ptr, value)    AO_fetch_and_add(_ptr, value)
-   /* GCC 3.2.0 on HP-UX crashes on cmpxchg_ptr() */
-#  if !(defined(__hpux) && __GNUC__ == 3 && __GNUC_MINOR__ == 2)
-#   define HAVE_CMPXCHG
-#  endif
 # define HAVE_FETCH_AND_ADD
 #else
 # ifdef HAVE_IA64INTRIN_H
 #  include <ia64intrin.h>
-static inline int
-cmpxchg_ptr (void *addr, void *old, void *new)
-{
-  union
-    {
-      void *vp;
-      long *vlp;
-    }
-  u;
-
-  u.vp = addr;
-  return __sync_bool_compare_and_swap(u.vlp, (long) old, (long) new);
-}
 #  define fetch_and_add1(_ptr)         __sync_fetch_and_add(_ptr, 1)
 #  define fetch_and_add(_ptr, value)   __sync_fetch_and_add(_ptr, value)
-#  define HAVE_CMPXCHG
 #  define HAVE_FETCH_AND_ADD
 # endif
 #endif
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]