patch_seq_maybe_yield

Function patch_seq_maybe_yield 

Source
#[unsafe(no_mangle)]
pub extern "C" fn patch_seq_maybe_yield()
Expand description

Maybe yield to other coroutines based on tail call count

Called before every tail call in generated code. When SEQ_YIELD_INTERVAL is set, yields after that many tail calls to prevent starvation.

§Performance

  • Disabled (default): Single branch on cached threshold (< 1ns)
  • Enabled: Increment + compare + occasional yield (~10-20ns average)

§Safety

Always safe to call. No-op when not in a May coroutine context.