MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_checkstack

Function lua_checkstack

lib/lua/src/lapi.c:111–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

luaL_checkstackFunction · 0.85
pmainFunction · 0.85
auxresumeFunction · 0.85
tunpackFunction · 0.85
checkstackFunction · 0.85

Calls 1

luaD_growstackFunction · 0.85

Tested by

no test coverage detected