From ad24cff0f1108ee8e2c28f72e10da44ea2205c10 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 21 Mar 2005 15:12:21 -0300 Subject: lua_gc(STEP) returns whether collection cycle finished --- lapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lapi.c b/lapi.c index 4fe845fd..a4a520de 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.33 2005/03/18 18:55:45 roberto Exp roberto $ +** $Id: lapi.c,v 2.34 2005/03/18 20:11:28 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -909,6 +909,8 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { g->GCthreshold = 0; while (g->GCthreshold <= g->totalbytes) luaC_step(L); + if (g->gcstate == GCSpause) /* end of cycle? */ + res = 1; /* signal it */ break; } case LUA_GCSETPACE: { -- cgit v1.2.3-55-g6feb