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

Function adaptive_counter_backoff

crates/compiler-core/src/bytecode.rs:503–510  ·  view source on GitHub ↗
(counter: u16)

Source from the content-addressed store, hash-verified

501/// Reset adaptive counter with exponential backoff.
502#[inline]
503pub const fn adaptive_counter_backoff(counter: u16) -> u16 {
504 let backoff = counter & ((1 << BACKOFF_BITS) - 1);
505 if backoff < MAX_BACKOFF {
506 adaptive_counter_bits((1 << (backoff + 1)) - 1, backoff + 1)
507 } else {
508 adaptive_counter_bits((1 << MAX_BACKOFF) - 1, MAX_BACKOFF)
509 }
510}
511
512impl CodeUnit {
513 pub const fn new(op: Instruction, arg: OpArgByte) -> Self {

Callers 10

specialize_load_attrMethod · 0.85
commit_specializationMethod · 0.85
specialize_callMethod · 0.85
specialize_call_kwMethod · 0.85
specialize_sendMethod · 0.85
specialize_to_boolMethod · 0.85
specialize_store_attrMethod · 0.85

Calls 1

adaptive_counter_bitsFunction · 0.85

Tested by

no test coverage detected