diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.120 2001/02/01 17:40:48 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.121 2001/02/02 15:13:05 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -251,7 +251,9 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) { | |||
251 | int status; | 251 | int status; |
252 | LUA_LOCK(L); | 252 | LUA_LOCK(L); |
253 | p.z = z; p.bin = bin; | 253 | p.z = z; p.bin = bin; |
254 | luaC_checkGC(L); | 254 | /* before parsing, give a (good) chance to GC */ |
255 | if (G(L)->nblocks/8 >= G(L)->GCthreshold/10) | ||
256 | luaC_collectgarbage(L); | ||
255 | old_blocks = G(L)->nblocks; | 257 | old_blocks = G(L)->nblocks; |
256 | status = luaD_runprotected(L, f_parser, &p); | 258 | status = luaD_runprotected(L, f_parser, &p); |
257 | if (status == 0) { | 259 | if (status == 0) { |