From 6b1eb154eff61cdfa00f1ce29eb3a4f9ec2f6f50 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Tue, 16 Apr 2024 14:50:06 +0800 Subject: [PATCH] disable under madsim Signed-off-by: Bugen Zhao --- src/common/src/util/recursive.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/src/util/recursive.rs b/src/common/src/util/recursive.rs index 6d315e443f827..1d627e94c1fbe 100644 --- a/src/common/src/util/recursive.rs +++ b/src/common/src/util/recursive.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +//! Track the recursion and grow the stack when necessary to enable fearless recursion. + use std::cell::RefCell; // See documentation of `stacker` for the meaning of these constants. @@ -92,7 +94,12 @@ impl Tracker { } let _guard = DepthGuard::new(&self.depth); - stacker::maybe_grow(RED_ZONE, STACK_SIZE, f) + + if cfg!(madsim) { + f() // madsim does not support stack growth + } else { + stacker::maybe_grow(RED_ZONE, STACK_SIZE, f) + } } }