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

Method reallocStack

stack.go:455–467  ·  view source on GitHub ↗
(newSize int)

Source from the content-addressed store, hash-verified

453}
454
455func (l *State) reallocStack(newSize int) {
456 l.assert(newSize <= maxStack || newSize == errorStackSize)
457 l.assert(l.stackLast == len(l.stack)-extraStack)
458 l.stack = append(l.stack, make([]value, newSize-len(l.stack))...)
459 l.stackLast = len(l.stack) - extraStack
460 l.callInfo.next = nil
461 for ci := l.callInfo; ci != nil; ci = ci.previous {
462 if ci.isLua() {
463 top := ci.top
464 ci.frame = l.stack[top-len(ci.frame) : top]
465 }
466 }
467}
468
469func (l *State) growStack(n int) {
470 if len(l.stack) > maxStack { // error after extra size?

Callers 1

growStackMethod · 0.95

Calls 2

assertMethod · 0.95
isLuaMethod · 0.80

Tested by

no test coverage detected