MCPcopy Create free account
hub / github.com/PolygonTek/BlueshiftEngine / lua_settop

Function lua_settop

Source/ThirdParty/luaJIT/src/lj_api.c:121–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121LUA_API void lua_settop(lua_State *L, int idx)
122{
123 if (idx >= 0) {
124 api_check(L, idx <= tvref(L->maxstack) - L->base);
125 if (L->base + idx > L->top) {
126 if (L->base + idx >= tvref(L->maxstack))
127 lj_state_growstack(L, (MSize)idx - (MSize)(L->top - L->base));
128 do { setnilV(L->top++); } while (L->top < L->base + idx);
129 } else {
130 L->top = L->base + idx;
131 }
132 } else {
133 api_check(L, -(idx+1) <= (L->top - L->base));
134 L->top += idx+1; /* Shrinks top (idx < 0). */
135 }
136}
137
138LUA_API void lua_remove(lua_State *L, int idx)
139{

Callers 7

lib_debug.cFile · 0.70
lib_base.cFile · 0.70
lib_table.cFile · 0.70
loadlineFunction · 0.70
dottyFunction · 0.70
lib_os.cFile · 0.70
lj_cf_package_requireFunction · 0.70

Calls 1

lj_state_growstackFunction · 0.85

Tested by

no test coverage detected