summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-09 11:43:39 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-09 11:43:39 +0100
commitb4770eb85369e91cbf800e8192dac0d8c0c627cf (patch)
tree12f49b03fc4a4f7fed77cc07da6f8def95c2b09d
parent0122eac105d316f54eb78f14279974ceb9593e6a (diff)
add noinline
clang is acting up somehow
-rw-r--r--compat/defs.hpp6
-rw-r--r--src/world.cpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/compat/defs.hpp b/compat/defs.hpp
index f4c440f8..585c45d1 100644
--- a/compat/defs.hpp
+++ b/compat/defs.hpp
@@ -47,3 +47,9 @@
#define fm_DECLARE_DEFAULT_MOVE_COPY_ASSIGNMENTS_(type) \
[[maybe_unused]] fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(type); \
[[maybe_unused]] fm_DECLARE_DEFAULT_COPY_ASSIGNMENT_(type)
+
+#ifdef _MSC_VER
+# define fm_noinline __declspec(noinline)
+#else
+# define fm_noinline __attribute__((noinline))
+#endif
diff --git a/src/world.cpp b/src/world.cpp
index 39b47db1..454f8e68 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -12,6 +12,7 @@ world::world(std::size_t capacity) : _chunks{capacity, hasher}
_chunks.max_load_factor(max_load_factor);
}
+fm_noinline
chunk& world::operator[](chunk_coords coord) noexcept
{
maybe_collect();