MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_c_stack_overflow

Method check_c_stack_overflow

crates/vm/src/vm/mod.rs:1520–1527  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1518 #[cfg(not(miri))]
1519 #[inline(always)]
1520 fn check_c_stack_overflow(&self) -> bool {
1521 let current_sp = psm::stack_pointer() as usize;
1522 let soft_limit = self.c_stack_soft_limit.get();
1523 // Stack grows downward: check if we're below soft limit but above hard limit
1524 // This matches CPython's _Py_MakeRecCheck behavior
1525 current_sp < soft_limit
1526 && current_sp >= soft_limit.saturating_sub(Self::STACK_MARGIN_BYTES * 2)
1527 }
1528
1529 /// Miri doesn't support inline assembly, so always return false.
1530 #[cfg(miri)]

Callers 2

with_recursionMethod · 0.80
resume_gen_frameMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected