aboutsummaryrefslogtreecommitdiff
path: root/include/apos/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/apos/utils.h')
-rw-r--r--include/apos/utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/apos/utils.h b/include/apos/utils.h
index 29969c4..6eeb54f 100644
--- a/include/apos/utils.h
+++ b/include/apos/utils.h
@@ -187,6 +187,17 @@
#endif
/**
+ * Signal to the compiler that some region is unreachable.
+ * Mainly used for debugging with instrumentation, though it could provide some
+ * micro-optimisations.
+*/
+#if __has_builtin(__builtin_unreachable)
+#define unreachable() __builtin_unreachable()
+#else
+#define unreachable()
+#endif
+
+/**
* Get container of some member.
*
* @param ptr Pointer to member in some structure.