[vlc-commits] Remove unused barrier()

Rémi Denis-Courmont git at videolan.org
Sat Nov 10 18:55:16 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 10 19:44:00 2012 +0200| [3afcc0bb1f929748cc7de65531d0adbdd97098c4] | committer: Rémi Denis-Courmont

Remove unused barrier()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3afcc0bb1f929748cc7de65531d0adbdd97098c4
---

 include/vlc_threads.h |   24 ------------------------
 src/misc/block.c      |    1 -
 2 files changed, 25 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index e38f5ba..0ae5252 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -148,7 +148,6 @@ typedef struct vlc_timer *vlc_timer_t;
 /* Unnamed POSIX semaphores not supported on Mac OS X */
 # include <mach/semaphore.h>
 # include <mach/task.h>
-# include <libkern/OSAtomic.h> /* OSMemoryBarrier() */
 # define LIBVLC_USE_PTHREAD           1
 # define LIBVLC_USE_PTHREAD_CLEANUP   1
 # define LIBVLC_USE_PTHREAD_CANCEL    1
@@ -486,29 +485,6 @@ static inline void vlc_spin_init (vlc_spinlock_t *spin)
 # define vlc_spin_destroy vlc_mutex_destroy
 #endif
 
-/**
- * Issues a full memory barrier.
- */
-static inline void barrier (void)
-{
-#if defined (__GNUC__) && !defined (__APPLE__) && \
-            ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
-    __sync_synchronize ();
-#elif defined(__APPLE__)
-    OSMemoryBarrier ();
-#elif defined(__powerpc__)
-    asm volatile ("sync":::"memory");
-#elif 0 // defined(__i386__) /*  Requires SSE2 support */
-    asm volatile ("mfence":::"memory");
-#else
-    vlc_spinlock_t spin;
-    vlc_spin_init (&spin);
-    vlc_spin_lock (&spin);
-    vlc_spin_unlock (&spin);
-    vlc_spin_destroy (&spin);
-#endif
-}
-
 #ifdef __cplusplus
 /**
  * Helper C++ class to lock a mutex.
diff --git a/src/misc/block.c b/src/misc/block.c
index b853d35..069628a 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -75,7 +75,6 @@ static void block_Invalidate (block_t *block)
     block->p_next = NULL;
     block_Check (block);
     block->pf_release = BlockNoRelease;
-    barrier (); /* prevent compiler from optimizing this assignment out */
 }
 #else
 # define block_Check(b) ((void)(b))



More information about the vlc-commits mailing list