diff options
-rw-r--r-- | lapi.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.121 2010/04/13 20:48:12 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.122 2010/04/18 13:22:48 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 | */ |
@@ -940,9 +940,7 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { | |||
940 | luaC_step(L); /* do a single step */ | 940 | luaC_step(L); /* do a single step */ |
941 | } | 941 | } |
942 | else { | 942 | else { |
943 | lu_mem a = (cast(lu_mem, data) << 10); | 943 | while (data-- >= 0) { |
944 | g->GCthreshold = (a <= g->totalbytes) ? g->totalbytes - a : 0; | ||
945 | while (g->GCthreshold <= g->totalbytes) { | ||
946 | luaC_step(L); | 944 | luaC_step(L); |
947 | if (g->gcstate == GCSpause) { /* end of cycle? */ | 945 | if (g->gcstate == GCSpause) { /* end of cycle? */ |
948 | res = 1; /* signal it */ | 946 | res = 1; /* signal it */ |