CheckStack ensures that there are at least size free stack slots in the stack. This call will not panic(), unlike the other Check*() functions. http://www.lua.org/manual/5.2/manual.html#lua_checkstack
(size int)
| 613 | // |
| 614 | // http://www.lua.org/manual/5.2/manual.html#lua_checkstack |
| 615 | func (l *State) CheckStack(size int) bool { |
| 616 | callInfo := l.callInfo |
| 617 | ok := l.stackLast-l.top > size |
| 618 | if !ok && l.top+extraStack <= maxStack-size { |
| 619 | ok = l.protect(func() { l.growStack(size) }) == nil |
| 620 | } |
| 621 | if ok && callInfo.top < l.top+size { |
| 622 | callInfo.setTop(l.top + size) |
| 623 | } |
| 624 | return ok |
| 625 | } |
| 626 | |
| 627 | // AtPanic sets a new panic function and returns the old one. |
| 628 | func AtPanic(l *State, panicFunction Function) Function { |
no test coverage detected