MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_settop

Function lua_settop

src/Chain/libraries/glua/lapi.cpp:175–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174
175LUA_API void lua_settop(lua_State *L, int idx) {
176 StkId func = L->ci->func;
177 lua_lock(L);
178 if (idx >= 0) {
179 api_check(L, idx <= L->stack_last - (func + 1), "new top too large");
180 while (L->top < (func + 1) + idx)
181 setnilvalue(L->top++);
182 L->top = (func + 1) + idx;
183 }
184 else {
185 api_check(L, -(idx + 1) <= (L->top - (func + 1)), "invalid new top");
186 L->top += idx + 1; /* 'subtract' index (index is negative) */
187 }
188 lua_unlock(L);
189}
190
191
192/*

Callers 15

os_timeFunction · 0.85
sortFunction · 0.85
str_dumpFunction · 0.85
gmatchFunction · 0.85
io_readlineFunction · 0.85
pushglobalfuncnameFunction · 0.85
luaL_require_moduleFunction · 0.85
luaL_loadfilexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected