Use the new __cheriot_minimum_stack__ when performing stack checks.
diff --git a/sdk/core/allocator/alloc_config.h b/sdk/core/allocator/alloc_config.h
index 522ed8a..65af7af 100644
--- a/sdk/core/allocator/alloc_config.h
+++ b/sdk/core/allocator/alloc_config.h
@@ -34,5 +34,15 @@
 #endif
   ;
 
-#define STACK_CHECK(expected)                                                  \
-	StackUsageCheck<StackMode, expected, __PRETTY_FUNCTION__> stackCheck
+#if defined(__CHERIOT__) && (__CHERIOT__ >= 20250108)
+#	define STACK_CHECK(expected)                                              \
+		static_assert((expected) == __cheriot_minimum_stack__,                 \
+		              "Explicit stack check does not match annotation!");      \
+		StackUsageCheck<StackMode,                                             \
+		                __cheriot_minimum_stack__,                             \
+		                __PRETTY_FUNCTION__>                                   \
+		  stackCheck
+#else
+#	define STACK_CHECK(expected)                                              \
+		StackUsageCheck<StackMode, expected, __PRETTY_FUNCTION__> stackCheck
+#endif