MCPcopy Index your code
hub / github.com/yuin/gopher-lua / newAutoGrowingCallFrameStack

Function newAutoGrowingCallFrameStack

state.go:250–257  ·  view source on GitHub ↗

newCallFrameStack allocates a new stack for a lua state, which will auto grow up to a max size of at least maxSize. it will actually grow up to the next segment size multiple after maxSize, where the segment size is dictated by FramesPerSegment.

(maxSize int)

Source from the content-addressed store, hash-verified

248// it will actually grow up to the next segment size multiple after maxSize, where the segment size is dictated by
249// FramesPerSegment.
250func newAutoGrowingCallFrameStack(maxSize int) callFrameStack {
251 cs := &autoGrowingCallFrameStack{
252 segments: make([]*callFrameStackSegment, (maxSize+(FramesPerSegment-1))/FramesPerSegment),
253 segIdx: 0,
254 }
255 cs.segments[0] = newCallFrameStackSegment()
256 return cs
257}
258
259func (cs *autoGrowingCallFrameStack) IsEmpty() bool {
260 return cs.segIdx == 0 && cs.segSp == 0

Calls 1

newCallFrameStackSegmentFunction · 0.70

Used in the wild real call sites across dependent graphs

searching dependent graphs…