From b495cffa50bb1442bf19172bf1c8d31bc1abcfe3 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 30 May 2024 12:25:06 -0500 Subject: [PATCH] fixup! Add workaround for targets with too small a main stack size --- build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index f1b0a3046..6284b7e3e 100644 --- a/build.rs +++ b/build.rs @@ -192,9 +192,9 @@ fn has_small_stack(_: &Target) -> Result> { // build.rs is executed on the main thread, so we are getting the main thread's stack size. // Modern macOS versions default to an 8 MiB main stack but legacy OS X have a 0.5 MiB one. let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) }; - const TWO_MIB: usize = 2 * 1024 * 1024; + const TWO_MIB: usize = 2 * 1024 * 1024 - 1; match stack_size { - 0..TWO_MIB => Ok(true), + 0..=TWO_MIB => Ok(true), _ => Ok(false), } }