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

Function next_func_version

crates/vm/src/builtins/function.rs:85–89  ·  view source on GitHub ↗

Atomically allocate the next function version, returning 0 if exhausted. Once the counter wraps to 0, it stays at 0 permanently.

()

Source from the content-addressed store, hash-verified

83/// Atomically allocate the next function version, returning 0 if exhausted.
84/// Once the counter wraps to 0, it stays at 0 permanently.
85fn next_func_version() -> u32 {
86 FUNC_VERSION_COUNTER
87 .fetch_update(Relaxed, Relaxed, |v| (v != 0).then(|| v.wrapping_add(1)))
88 .unwrap_or(0)
89}
90
91unsafe impl Traverse for PyFunction {
92 fn traverse(&self, tracer_fn: &mut TraverseFn<'_>) {

Callers 2

newMethod · 0.85

Calls 1

thenMethod · 0.45

Tested by

no test coverage detected