(i: &PyInt, vm: &VirtualMachine)
| 1132 | |
| 1133 | #[inline] |
| 1134 | fn specialization_nonnegative_compact_index(i: &PyInt, vm: &VirtualMachine) -> Option<usize> { |
| 1135 | // _PyLong_IsNonNegativeCompact(): a single base-2^30 digit. |
| 1136 | const CPYTHON_COMPACT_LONG_MAX: u64 = (1u64 << 30) - 1; |
| 1137 | let v = i.try_to_primitive::<u64>(vm).ok()?; |
| 1138 | if v <= CPYTHON_COMPACT_LONG_MAX { |
| 1139 | Some(v as usize) |
| 1140 | } else { |
| 1141 | None |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | fn release_datastack_frame(frame: &Py<Frame>, vm: &VirtualMachine) { |
| 1146 | unsafe { |
no test coverage detected