MCPcopy Create free account
hub / github.com/yuin/gopher-lua / newLState

Function newLState

state.go:664–690  ·  view source on GitHub ↗
(options Options)

Source from the content-addressed store, hash-verified

662}
663
664func newLState(options Options) *LState {
665 al := newAllocator(32)
666 ls := &LState{
667 G: newGlobal(),
668 Parent: nil,
669 Panic: panicWithTraceback,
670 Dead: false,
671 Options: options,
672
673 stop: 0,
674 alloc: al,
675 currentFrame: nil,
676 wrapped: false,
677 uvcache: nil,
678 hasErrorFunc: false,
679 mainLoop: mainLoop,
680 ctx: nil,
681 }
682 if options.MinimizeStackMemory {
683 ls.stack = newAutoGrowingCallFrameStack(options.CallStackSize)
684 } else {
685 ls.stack = newFixedCallFrameStack(options.CallStackSize)
686 }
687 ls.reg = newRegistry(ls, options.RegistrySize, options.RegistryGrowStep, options.RegistryMaxSize, al)
688 ls.Env = ls.G.Global
689 return ls
690}
691
692func (ls *LState) printReg() {
693 println("-------------------------")

Callers 2

NewStateFunction · 0.70
NewThreadMethod · 0.70

Calls 5

newAllocatorFunction · 0.85
newGlobalFunction · 0.70
newFixedCallFrameStackFunction · 0.70
newRegistryFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…