aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 872156ea..8bcd14fe 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.29 2005/04/05 13:41:29 roberto Exp roberto $ 2** $Id: lstate.c,v 2.30 2005/04/05 15:57:59 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -141,6 +141,7 @@ void luaE_freethread (lua_State *L, lua_State *L1) {
141 141
142 142
143LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { 143LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
144 int i;
144 lua_State *L; 145 lua_State *L;
145 global_State *g; 146 global_State *g;
146 void *l = (*f)(ud, NULL, 0, state_size(LG)); 147 void *l = (*f)(ud, NULL, 0, state_size(LG));
@@ -177,6 +178,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
177 g->gcpause = LUAI_GCPAUSE; 178 g->gcpause = LUAI_GCPAUSE;
178 g->gcstepmul = LUAI_GCMUL; 179 g->gcstepmul = LUAI_GCMUL;
179 g->gcdept = 0; 180 g->gcdept = 0;
181 for (i=0; i<NUM_TAGS; i++) g->mt[i] = NULL;
180 if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { 182 if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) {
181 /* memory allocation error: free partial state */ 183 /* memory allocation error: free partial state */
182 close_state(L); 184 close_state(L);