MCPcopy Index your code
hub / github.com/Shopify/go-lua / CheckStack

Method CheckStack

lua.go:615–625  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

613//
614// http://www.lua.org/manual/5.2/manual.html#lua_checkstack
615func (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.
628func AtPanic(l *State, panicFunction Function) Function {

Callers 4

finishProtectedCallFunction · 0.45
forListMethod · 0.45
table.goFile · 0.45
CheckStackWithMessageFunction · 0.45

Calls 3

protectMethod · 0.95
growStackMethod · 0.95
setTopMethod · 0.80

Tested by

no test coverage detected