default now is multi-state

This commit is contained in:
Roberto Ierusalimschy
2000-08-09 16:16:57 -03:00
parent fdd04e7a7f
commit e238efc536
30 changed files with 230 additions and 212 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstate.c,v 1.30 2000/08/04 19:38:35 roberto Exp roberto $
** $Id: lstate.c,v 1.31 2000/08/08 20:42:07 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -7,8 +7,6 @@
#include <stdarg.h>
#define LUA_REENTRANT
#include "lua.h"
#include "lauxlib.h"
@@ -24,9 +22,6 @@
#include "ltm.h"
lua_State *lua_state = NULL;
lua_State *lua_newstate (int stacksize, int put_builtin) {
struct lua_longjmp myErrorJmp;
lua_State *L = luaM_new(NULL, lua_State);
@@ -75,6 +70,8 @@ lua_State *lua_newstate (int stacksize, int put_builtin) {
}
extern lua_State *lua_state;
void lua_close (lua_State *L) {
luaC_collect(L, 1); /* collect all elements */
LUA_ASSERT(L->rootproto == NULL, "list should be empty");