summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChi-hung Hsieh <chh@google.com>2015-05-28 03:31:51 (GMT)
committerJason Evans <jasone@canonware.com>2015-05-28 03:33:18 (GMT)
commitc073f8167a96a9bec98c61df4d2461811c3c10a4 (patch)
treed2ec53156cae399482423f53a73eeb1dcb0ca316 /include
parent836bbe9951a903b2d76af53dfb3ad53ad186f8b9 (diff)
downloadjemalloc-c073f8167a96a9bec98c61df4d2461811c3c10a4.zip
jemalloc-c073f8167a96a9bec98c61df4d2461811c3c10a4.tar.gz
jemalloc-c073f8167a96a9bec98c61df4d2461811c3c10a4.tar.bz2
Fix type errors in C11 versions of atomic_*() functions.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/atomic.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/jemalloc/internal/atomic.h b/include/jemalloc/internal/atomic.h
index 522dd2a..a9aad35 100644
--- a/include/jemalloc/internal/atomic.h
+++ b/include/jemalloc/internal/atomic.h
@@ -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
@@ -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