aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lstate.c b/lstate.c
index 54917649..33a5cd7d 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.20 2005/01/04 15:55:12 roberto Exp roberto $ 2** $Id: lstate.c,v 2.21 2005/01/05 18:20:51 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*/
@@ -95,7 +95,6 @@ static void f_luaopen (lua_State *L, void *ud) {
95 luaX_init(L); 95 luaX_init(L);
96 luaS_fix(luaS_newliteral(L, MEMERRMSG)); 96 luaS_fix(luaS_newliteral(L, MEMERRMSG));
97 g->GCthreshold = 4*g->totalbytes; 97 g->GCthreshold = 4*g->totalbytes;
98 g->prevestimate = g->estimate = g->totalbytes;
99} 98}
100 99
101 100
@@ -180,7 +179,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
180 luaZ_initbuffer(L, &g->buff); 179 luaZ_initbuffer(L, &g->buff);
181 g->panic = NULL; 180 g->panic = NULL;
182 g->gcstate = GCSpause; 181 g->gcstate = GCSpause;
183 g->gcgenerational = 0;
184 g->rootgc = obj2gco(L); 182 g->rootgc = obj2gco(L);
185 g->sweepstrgc = 0; 183 g->sweepstrgc = 0;
186 g->sweepgc = &g->rootgc; 184 g->sweepgc = &g->rootgc;
@@ -190,8 +188,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
190 g->weak = NULL; 188 g->weak = NULL;
191 g->tmudata = NULL; 189 g->tmudata = NULL;
192 g->totalbytes = sizeof(LG); 190 g->totalbytes = sizeof(LG);
193 g->gcpace = GCDIV; 191 g->gcpace = 200; /* 200% (wait memory to double before next collection) */
194 g->incgc = 1; 192 g->gcstepmul = 200; /* GC runs `twice the speed' of memory allocation */
193 g->gcdept = 0;
195 if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { 194 if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) {
196 /* memory allocation error: free partial state */ 195 /* memory allocation error: free partial state */
197 close_state(L); 196 close_state(L);