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)
| 248 | // it will actually grow up to the next segment size multiple after maxSize, where the segment size is dictated by |
| 249 | // FramesPerSegment. |
| 250 | func 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 | |
| 259 | func (cs *autoGrowingCallFrameStack) IsEmpty() bool { |
| 260 | return cs.segIdx == 0 && cs.segSp == 0 |
searching dependent graphs…