/* 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'.)  */
LUALIB_API void luaL_checkstack(lua_State *L, int space, const char *msg)
/* 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'.)  */
LUALIB_API void luaL_checkstack(lua_State *L, int space, const char *msg)
{
    if (msg)
      luaL_error(L, "stack overflow (%s)", msg);
    else
      luaL_error(L, "stack overflow");
  }
}