MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_checkstack

Function lua_checkstack

third-party/lua-5.5.0/src/lapi.c:109–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108
109LUA_API int lua_checkstack (lua_State *L, int n) {
110 int res;
111 CallInfo *ci;
112 lua_lock(L);
113 ci = L->ci;
114 api_check(L, n >= 0, "negative 'n'");
115 if (L->stack_last.p - L->top.p > n) /* stack large enough? */
116 res = 1; /* yes; check is OK */
117 else /* need to grow stack */
118 res = luaD_growstack(L, n, 0);
119 if (res && ci->top.p < L->top.p + n)
120 ci->top.p = L->top.p + n; /* adjust frame top */
121 lua_unlock(L);
122 return res;
123}
124
125
126LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {

Callers 5

luaL_checkstackFunction · 0.70
pmainFunction · 0.70
auxresumeFunction · 0.70
tunpackFunction · 0.70
checkstackFunction · 0.70

Calls 1

luaD_growstackFunction · 0.70

Tested by

no test coverage detected