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

Function specialization_nonnegative_compact_index

crates/vm/src/frame.rs:1134–1143  ·  view source on GitHub ↗
(i: &PyInt, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1132
1133#[inline]
1134fn 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
1145fn release_datastack_frame(frame: &Py<Frame>, vm: &VirtualMachine) {
1146 unsafe {

Callers 3

execute_instructionMethod · 0.85
specialize_binary_opMethod · 0.85

Calls 2

okMethod · 0.80
SomeClass · 0.50

Tested by

no test coverage detected