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

Method SetTop

state.go:1458–1466  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

1456}
1457
1458func (ls *LState) SetTop(idx int) {
1459 base := ls.currentLocalBase()
1460 newtop := ls.indexToReg(idx) + 1
1461 if newtop < base {
1462 ls.reg.SetTop(base)
1463 } else {
1464 ls.reg.SetTop(newtop)
1465 }
1466}
1467
1468func (ls *LState) Replace(idx int, value LValue) {
1469 base := ls.currentLocalBase()

Callers 15

ResumeMethod · 0.95
YieldMethod · 0.95
XMoveToMethod · 0.95
baseLoadFunction · 0.45
baseSetMetatableFunction · 0.45
baseNewProxyFunction · 0.45
ioPopenFunction · 0.45
switchToParentThreadFunction · 0.45
threadRunFunction · 0.45
initFunction · 0.45
strGsubFunction · 0.45
debugSetMetatableFunction · 0.45

Calls 2

currentLocalBaseMethod · 0.95
indexToRegMethod · 0.95

Tested by 1

BenchmarkRegistrySetTopFunction · 0.36