(&self)
| 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)] |
no test coverage detected