** Ensures the stack has at least 'space' extra slots, raising an error ** if it cannot fulfill the request. (The error handling needs a few ** extra slots to format the error message. In case of an error without ** this extra space, Lua will generate the same 'stack overflow' error, ** but without 'msg'.) */
| 384 | ** but without 'msg'.) |
| 385 | */ |
| 386 | LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { |
| 387 | if (l_unlikely(!lua_checkstack(L, space))) { |
| 388 | if (msg) |
| 389 | luaL_error(L, "stack overflow (%s)", msg); |
| 390 | else |
| 391 | luaL_error(L, "stack overflow"); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | |
| 396 | LUALIB_API void luaL_checktype (lua_State *L, int arg, int t) { |
no test coverage detected