processDelayed processes all delayed actions pushed after top.
(top int)
| 371 | |
| 372 | // processDelayed processes all delayed actions pushed after top. |
| 373 | func (check *Checker) processDelayed(top int) { |
| 374 | // If each delayed action pushes a new action, the |
| 375 | // stack will continue to grow during this loop. |
| 376 | // However, it is only processing functions (which |
| 377 | // are processed in a delayed fashion) that may |
| 378 | // add more actions (such as nested functions), so |
| 379 | // this is a sufficiently bounded process. |
| 380 | for i := top; i < len(check.delayed); i++ { |
| 381 | a := &check.delayed[i] |
| 382 | if check.conf.Trace { |
| 383 | if a.desc != nil { |
| 384 | check.trace(a.desc.pos.Pos(), "-- "+a.desc.format, a.desc.args...) |
| 385 | } else { |
| 386 | check.trace(nopos, "-- delayed %p", a.f) |
| 387 | } |
| 388 | } |
| 389 | a.f() // may append to check.delayed |
| 390 | if check.conf.Trace { |
| 391 | fmt.Println() |
| 392 | } |
| 393 | } |
| 394 | assert(top <= len(check.delayed)) // stack must not have shrunk |
| 395 | check.delayed = check.delayed[:top] |
| 396 | } |
| 397 | |
| 398 | // cleanup runs cleanup for all collected cleaners. |
| 399 | func (check *Checker) cleanup() { |
no test coverage detected