diff options
author | theuni <theuni-nospam@xbmc.org> | 2013-11-25 19:24:23 -0500 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-12-05 13:10:24 +0100 |
commit | d3381e71a1b30a804b5b0fc993b189af53205bb2 (patch) | |
tree | ee085990b48a2bb9fd659b9b7293f9ea43afebdf /src/leveldb | |
parent | 77f7bcb352cfaac2549bf7f25dcaeb808204c185 (diff) | |
download | bitcoin-d3381e71a1b30a804b5b0fc993b189af53205bb2.tar.xz |
leveldb: Use native Darwin memory barriers
Diffstat (limited to 'src/leveldb')
-rw-r--r-- | src/leveldb/port/atomic_pointer.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/leveldb/port/atomic_pointer.h b/src/leveldb/port/atomic_pointer.h index e17bf435ea..844fba25fe 100644 --- a/src/leveldb/port/atomic_pointer.h +++ b/src/leveldb/port/atomic_pointer.h @@ -50,6 +50,13 @@ namespace port { // http://msdn.microsoft.com/en-us/library/ms684208(v=vs.85).aspx #define LEVELDB_HAVE_MEMORY_BARRIER +// Mac OS +#elif defined(OS_MACOSX) +inline void MemoryBarrier() { + OSMemoryBarrier(); +} +#define LEVELDB_HAVE_MEMORY_BARRIER + // Gcc on x86 #elif defined(ARCH_CPU_X86_FAMILY) && defined(__GNUC__) inline void MemoryBarrier() { @@ -62,19 +69,12 @@ inline void MemoryBarrier() { // Sun Studio #elif defined(ARCH_CPU_X86_FAMILY) && defined(__SUNPRO_CC) inline void MemoryBarrier() { - // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on + // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering. asm volatile("" : : : "memory"); } #define LEVELDB_HAVE_MEMORY_BARRIER -// Mac OS -#elif defined(OS_MACOSX) -inline void MemoryBarrier() { - OSMemoryBarrier(); -} -#define LEVELDB_HAVE_MEMORY_BARRIER - // ARM Linux #elif defined(ARCH_CPU_ARM_FAMILY) && defined(__linux__) typedef void (*LinuxKernelMemoryBarrierFunc)(void); |