diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-23 12:42:27 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-23 12:42:27 -0300 |
commit | 21ed264a38862a25964fc02365e1deea5ffcb6c9 (patch) | |
tree | bd1483423a824ed65aba006a36fdeb439aab4740 | |
parent | e131eb0d9a6252e41e1a46319c95f7dbb0a435c9 (diff) | |
download | lua-21ed264a38862a25964fc02365e1deea5ffcb6c9.tar.gz lua-21ed264a38862a25964fc02365e1deea5ffcb6c9.tar.bz2 lua-21ed264a38862a25964fc02365e1deea5ffcb6c9.zip |
compensate for 'GCSTEPSIZE' in GC steps
-rw-r--r-- | lapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.161 2012/05/21 13:18:10 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.162 2012/05/22 17:50:39 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1049,7 +1049,7 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { | |||
1049 | luaC_forcestep(L); /* do a single step */ | 1049 | luaC_forcestep(L); /* do a single step */ |
1050 | } | 1050 | } |
1051 | else { | 1051 | else { |
1052 | lu_mem debt = cast(lu_mem, data) * 1024; /* count in Kbytes */ | 1052 | lu_mem debt = cast(lu_mem, data) * 1024 - GCSTEPSIZE; |
1053 | if (g->gcrunning) | 1053 | if (g->gcrunning) |
1054 | debt += g->GCdebt; /* include current debt */ | 1054 | debt += g->GCdebt; /* include current debt */ |
1055 | luaE_setdebt(g, debt); | 1055 | luaE_setdebt(g, debt); |