summaryrefslogtreecommitdiffstats
path: root/src/bfs.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-01-16 14:19:25 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-01-16 14:19:25 -0500
commit95bc3ed03bf192e3e62278850101fb94d46ab660 (patch)
treed7b17cde6f8fbda4442109ab495fcb96e5757a3e /src/bfs.h
parentf04557374dd37a15842197ce075be600276d341d (diff)
downloadbfs-95bc3ed03bf192e3e62278850101fb94d46ab660.tar.xz
ioq: Don't unroll the spin loop
Diffstat (limited to 'src/bfs.h')
-rw-r--r--src/bfs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bfs.h b/src/bfs.h
index af4cf9f..6c930ad 100644
--- a/src/bfs.h
+++ b/src/bfs.h
@@ -218,4 +218,15 @@ extern const char bfs_ldlibs[];
# define _target_clones(...)
#endif
+/**
+ * Optimization hint to not unroll a loop.
+ */
+#if __clang__
+# define _nounroll _Pragma("nounroll")
+#elif __GNUC__
+# define _nounroll _Pragma("GCC unroll 0")
+#else
+# define _nounroll
+#endif
+
#endif // BFS_H