| 109 | |
| 110 | |
| 111 | LUA_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 | |
| 128 | LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { |
no test coverage detected