explicit stack control in the API

This commit is contained in:
Roberto Ierusalimschy
2000-08-29 17:43:28 -03:00
parent 4135f4f586
commit a97f29f154
7 changed files with 27 additions and 16 deletions

View File

@@ -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