From e1249970c2d058d173e7b1c1dc7deab1ccd68b7d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 26 May 1997 11:42:51 -0300 Subject: new API function to force garbage collection. --- inout.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'inout.c') diff --git a/inout.c b/inout.c index 6b3e490f..d0bd707e 100644 --- a/inout.c +++ b/inout.c @@ -5,7 +5,7 @@ ** Also provides some predefined lua functions. */ -char *rcs_inout="$Id: inout.c,v 2.57 1997/04/06 14:14:27 roberto Exp roberto $"; +char *rcs_inout="$Id: inout.c,v 2.58 1997/04/15 17:32:47 roberto Exp roberto $"; #include #include @@ -310,6 +310,11 @@ static void rawsettable (void) } +static void luaI_collectgarbage (void) +{ + lua_pushnumber(lua_collectgarbage(luaL_opt_number(1, 0))); +} + /* ** Internal functions @@ -320,6 +325,7 @@ static struct { } int_funcs[] = { {"assert", luaI_assert}, {"call", luaI_call}, + {"callgc", luaI_collectgarbage}, {"dofile", lua_internaldofile}, {"dostring", lua_internaldostring}, {"error", luaI_error}, -- cgit v1.2.3-55-g6feb