MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / stackinuse

Function stackinuse

3rd/lua-5.4.3/src/ldo.c:250–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250static int stackinuse (lua_State *L) {
251 CallInfo *ci;
252 int res;
253 StkId lim = L->top;
254 for (ci = L->ci; ci != NULL; ci = ci->previous) {
255 if (lim < ci->top) lim = ci->top;
256 }
257 lua_assert(lim <= L->stack_last);
258 res = cast_int(lim - L->stack) + 1; /* part of stack in use */
259 if (res < LUA_MINSTACK)
260 res = LUA_MINSTACK; /* ensure a minimum size */
261 return res;
262}
263
264
265/*

Callers 1

luaD_shrinkstackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected