Skip to content

Commit

Permalink
Fix type errors in C11 versions of atomic_*() functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
chih-hung authored and jasone committed May 28, 2015
1 parent 836bbe9 commit c073f81
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/jemalloc/internal/atomic.h
Expand Up @@ -143,15 +143,15 @@ atomic_sub_uint64(uint64_t *p, uint64_t x)
JEMALLOC_INLINE bool
atomic_cas_uint64(uint64_t *p, uint64_t c, uint64_t s)
{

return (!atomic_compare_exchange_strong(p, &c, s));
volatile atomic_uint_least64_t *a = (volatile atomic_uint_least64_t *)p;
return (!atomic_compare_exchange_strong(a, &c, s));
}

JEMALLOC_INLINE void
atomic_write_uint64(uint64_t *p, uint64_t x)
{

atomic_store(p, x);
volatile atomic_uint_least64_t *a = (volatile atomic_uint_least64_t *)p;
atomic_store(a, x);
}
# elif (defined(JEMALLOC_ATOMIC9))
JEMALLOC_INLINE uint64_t
Expand Down Expand Up @@ -367,15 +367,15 @@ atomic_sub_uint32(uint32_t *p, uint32_t x)
JEMALLOC_INLINE bool
atomic_cas_uint32(uint32_t *p, uint32_t c, uint32_t s)
{

return (!atomic_compare_exchange_strong(p, &c, s));
volatile atomic_uint_least32_t *a = (volatile atomic_uint_least32_t *)p;
return (!atomic_compare_exchange_strong(a, &c, s));
}

JEMALLOC_INLINE void
atomic_write_uint32(uint32_t *p, uint32_t x)
{

atomic_store(p, x);
volatile atomic_uint_least32_t *a = (volatile atomic_uint_least32_t *)p;
atomic_store(a, x);
}
#elif (defined(JEMALLOC_ATOMIC9))
JEMALLOC_INLINE uint32_t
Expand Down

0 comments on commit c073f81

Please sign in to comment.