diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-02 14:23:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-02 14:23:20 -0200 |
commit | 42224ca5538293f2b4a217e813bc437ca673b3cf (patch) | |
tree | 828645aee767bc1d5cc54089f2446b8854d3dabb /ldo.c | |
parent | 426d3e43bdec4b1ab2b0aed1844396c27f64872f (diff) | |
download | lua-42224ca5538293f2b4a217e813bc437ca673b3cf.tar.gz lua-42224ca5538293f2b4a217e813bc437ca673b3cf.tar.bz2 lua-42224ca5538293f2b4a217e813bc437ca673b3cf.zip |
loop of 'dostring' may never reclaim memory
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) { |