diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-10-31 13:29:28 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-10-31 13:29:28 -0200 |
| commit | de9128d09d55318f81d58fc8933ef180885c8850 (patch) | |
| tree | 136297a46feca167af0c683aa34c32a8ad6e587c | |
| parent | 1d8920dd7f508af5f2fd743678be1327f30c079b (diff) | |
| download | lua-de9128d09d55318f81d58fc8933ef180885c8850.tar.gz lua-de9128d09d55318f81d58fc8933ef180885c8850.tar.bz2 lua-de9128d09d55318f81d58fc8933ef180885c8850.zip | |
do not mess up the debt when the collector is not running
| -rw-r--r-- | lgc.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 2.234 2017/08/31 16:06:51 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.235 2017/10/11 12:38:45 roberto Exp roberto $ |
| 3 | ** Garbage Collector | 3 | ** Garbage Collector |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -1503,12 +1503,12 @@ static void incstep (lua_State *L, global_State *g) { | |||
| 1503 | */ | 1503 | */ |
| 1504 | void luaC_step (lua_State *L) { | 1504 | void luaC_step (lua_State *L) { |
| 1505 | global_State *g = G(L); | 1505 | global_State *g = G(L); |
| 1506 | if (!g->gcrunning) /* not running? */ | 1506 | if (g->gcrunning) { /* running? */ |
| 1507 | luaE_setdebt(g, -MAX_LMEM); /* avoid being called without need */ | 1507 | if (g->gckind == KGC_INC) |
| 1508 | else if (g->gckind == KGC_INC) | 1508 | incstep(L, g); |
| 1509 | incstep(L, g); | 1509 | else |
| 1510 | else | 1510 | genstep(L, g); |
| 1511 | genstep(L, g); | 1511 | } |
| 1512 | } | 1512 | } |
| 1513 | 1513 | ||
| 1514 | 1514 | ||
