summaryrefslogtreecommitdiffstats
path: root/include/jemalloc
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2017-03-04 00:43:47 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-03-06 23:08:43 (GMT)
commit84326c566af7d20662ee927c2daef0f63ccd3841 (patch)
treebedb62f18b20192e861a77023899551990a4552b /include/jemalloc
parente9852b577643433a2ecfef1026f1f9498e723654 (diff)
downloadjemalloc-84326c566af7d20662ee927c2daef0f63ccd3841.zip
jemalloc-84326c566af7d20662ee927c2daef0f63ccd3841.tar.gz
jemalloc-84326c566af7d20662ee927c2daef0f63ccd3841.tar.bz2
Insert not_reached after an exhaustive switch
In the C11 atomics backport, we couldn't use not_reached() in atomic_enum_to_builtin (in atomic_gcc_atomic.h), since atomic.h was hermetic and assert.h wasn't; there was a dependency issue. assert.h is hermetic now, so we can include it.
Diffstat (limited to 'include/jemalloc')
-rw-r--r--include/jemalloc/internal/atomic_gcc_atomic.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/jemalloc/internal/atomic_gcc_atomic.h b/include/jemalloc/internal/atomic_gcc_atomic.h
index 3d13b4a..6b73a14 100644
--- a/include/jemalloc/internal/atomic_gcc_atomic.h
+++ b/include/jemalloc/internal/atomic_gcc_atomic.h
@@ -1,6 +1,8 @@
#ifndef JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H
#define JEMALLOC_INTERNAL_ATOMIC_GCC_ATOMIC_H
+#include "jemalloc/internal/assert.h"
+
#define ATOMIC_INIT(...) {__VA_ARGS__}
typedef enum {
@@ -25,8 +27,8 @@ atomic_enum_to_builtin(atomic_memory_order_t mo) {
case atomic_memory_order_seq_cst:
return __ATOMIC_SEQ_CST;
}
- /* Can't actually happen; the switch is exhaustive. */
- return __ATOMIC_SEQ_CST;
+ /* Can't happen; the switch is exhaustive. */
+ not_reached();
}
ATOMIC_INLINE void