#pragma once
+#include <cstdlib>
+
#include <folly/Portability.h>
#include <glog/logging.h>
#endif
}
+[[noreturn]] FOLLY_ALWAYS_INLINE void assume_unreachable() {
+ assume(false);
+ // Do a bit more to get the compiler to understand
+ // that this function really will never return.
+#if defined(__GNUC__)
+ __builtin_unreachable();
+#elif defined(_MSC_VER)
+ __assume(0);
+#else
+ // Well, it's better than nothing.
+ std::abort();
+#endif
+}
+
} // namespace folly
}
}
pthread_exit((void *) numInserted);
- folly::assume(false);
+ folly::assume_unreachable();
}
TEST(Ahm, atomic_hash_array_insert_race) {
AHA* arr = atomicHashArrayInsertRaceArray.get();