MCPcopy Create free account
hub / github.com/desertbit/timer / siftupTimer

Function siftupTimer

timers.go:162–178  ·  view source on GitHub ↗

Heap maintenance algorithms. Based on golang source /runtime/time.go

(i int)

Source from the content-addressed store, hash-verified

160// Based on golang source /runtime/time.go
161
162func siftupTimer(i int) {
163 tmp := timers[i]
164 when := tmp.when
165
166 var p int
167 for i > 0 {
168 p = (i - 1) / 4 // parent
169 if !when.Before(timers[p].when) {
170 break
171 }
172 timers[i] = timers[p]
173 timers[i].i = i
174 timers[p] = tmp
175 timers[p].i = p
176 i = p
177 }
178}
179
180func siftdownTimer(i int) {
181 n := len(timers)

Callers 2

addTimerLockedFunction · 0.85
delTimerLockedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…