From 42224ca5538293f2b4a217e813bc437ca673b3cf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 2 Feb 2001 14:23:20 -0200 Subject: loop of 'dostring' may never reclaim memory --- ldo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ldo.c') diff --git a/ldo.c b/ldo.c index 296352fe..24f4a169 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.120 2001/02/01 17:40:48 roberto Exp roberto $ +** $Id: ldo.c,v 1.121 2001/02/02 15:13:05 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -251,7 +251,9 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) { int status; LUA_LOCK(L); p.z = z; p.bin = bin; - luaC_checkGC(L); + /* before parsing, give a (good) chance to GC */ + if (G(L)->nblocks/8 >= G(L)->GCthreshold/10) + luaC_collectgarbage(L); old_blocks = G(L)->nblocks; status = luaD_runprotected(L, f_parser, &p); if (status == 0) { -- cgit v1.2.3-55-g6feb