explicit stack control in the API
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lauxlib.c,v 1.31 2000/08/28 17:57:04 roberto Exp roberto $
|
||||
** $Id: lauxlib.c,v 1.32 2000/08/29 14:33:31 roberto Exp roberto $
|
||||
** Auxiliary functions for building Lua libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -49,6 +49,12 @@ static void type_error (lua_State *L, int narg, const char *type_name) {
|
||||
}
|
||||
|
||||
|
||||
void luaL_checkstack (lua_State *L, int space, const char *mes) {
|
||||
if (space > lua_stackspace(L))
|
||||
luaL_verror(L, "stack overflow (%.30s)", mes);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** use the 3rd letter of type names for testing:
|
||||
** nuMber, niL, stRing, fuNction, usErdata, taBle, anY
|
||||
|
||||
Reference in New Issue
Block a user