summaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lstate.c b/lstate.c
index 51272622..0d88c960 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.76 2010/03/29 17:43:14 roberto Exp roberto $ 2** $Id: lstate.c,v 2.77 2010/04/05 16:35:37 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*/
@@ -34,6 +34,9 @@
34#endif 34#endif
35 35
36 36
37#define MEMERRMSG "not enough memory"
38
39
37/* 40/*
38** thread state + extra space 41** thread state + extra space
39*/ 42*/
@@ -157,7 +160,9 @@ static void f_luaopen (lua_State *L, void *ud) {
157 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ 160 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
158 luaT_init(L); 161 luaT_init(L);
159 luaX_init(L); 162 luaX_init(L);
160 luaS_fix(luaS_newliteral(L, MEMERRMSG)); 163 /* pre-create memory-error message */
164 g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
165 luaS_fix(g->memerrmsg); /* it should never be collected */
161 g->GCthreshold = 4*g->totalbytes; 166 g->GCthreshold = 4*g->totalbytes;
162} 167}
163 168