diff options
| author | Jason Evans <jasone@canonware.com> | 2016-11-08 01:21:12 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-11-08 01:21:12 (GMT) |
| commit | 0110fa8451af905affd77c3bea0d545fee2251b2 (patch) | |
| tree | bb6683029386303f8474765409f26aad2d7cb821 /include/jemalloc/internal/atomic.h | |
| parent | 9bef119b42d2d5041621f975177fb7dc20fc447c (diff) | |
| parent | b0f56583b7f7abcdc00df42a0ae102bc64c5bd72 (diff) | |
| download | jemalloc-4.3.1.zip jemalloc-4.3.1.tar.gz jemalloc-4.3.1.tar.bz2 | |
Merge branch 'rc-4.3.1'4.3.1
Diffstat (limited to 'include/jemalloc/internal/atomic.h')
| -rw-r--r-- | include/jemalloc/internal/atomic.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/jemalloc/internal/atomic.h b/include/jemalloc/internal/atomic.h index 3936f68..3f15ea1 100644 --- a/include/jemalloc/internal/atomic.h +++ b/include/jemalloc/internal/atomic.h @@ -66,7 +66,8 @@ void atomic_write_u(unsigned *p, unsigned x); #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ATOMIC_C_)) /******************************************************************************/ /* 64-bit operations. */ -#if (defined(__amd64__) || defined(__x86_64__)) +#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3) +# if (defined(__amd64__) || defined(__x86_64__)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { @@ -124,7 +125,7 @@ atomic_write_uint64(uint64_t *p, uint64_t x) : "memory" /* Clobbers. */ ); } -#elif (defined(JEMALLOC_C11ATOMICS)) +# elif (defined(JEMALLOC_C11ATOMICS)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { @@ -152,7 +153,7 @@ atomic_write_uint64(uint64_t *p, uint64_t x) volatile atomic_uint_least64_t *a = (volatile atomic_uint_least64_t *)p; atomic_store(a, x); } -#elif (defined(JEMALLOC_ATOMIC9)) +# elif (defined(JEMALLOC_ATOMIC9)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { @@ -192,7 +193,7 @@ atomic_write_uint64(uint64_t *p, uint64_t x) atomic_store_rel_long(p, x); } -#elif (defined(JEMALLOC_OSATOMIC)) +# elif (defined(JEMALLOC_OSATOMIC)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { @@ -224,7 +225,7 @@ atomic_write_uint64(uint64_t *p, uint64_t x) o = atomic_read_uint64(p); } while (atomic_cas_uint64(p, o, x)); } -#elif (defined(_MSC_VER)) +# elif (defined(_MSC_VER)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { @@ -254,7 +255,7 @@ atomic_write_uint64(uint64_t *p, uint64_t x) InterlockedExchange64(p, x); } -#elif (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) || \ +# elif (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) || \ defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_8)) JEMALLOC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) @@ -283,8 +284,9 @@ atomic_write_uint64(uint64_t *p, uint64_t x) __sync_lock_test_and_set(p, x); } -#else -# error "Missing implementation for 64-bit atomic operations" +# else +# error "Missing implementation for 64-bit atomic operations" +# endif #endif /******************************************************************************/ |
