From 6a24bd17a8203394405005c1d63d08f0c7c25a27 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 14 Feb 2014 14:45:38 -0200 Subject: no more second result from 'collectgarbage"count"' (as Lua seldom will need lua_Number to be an integer) --- lbaselib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 0b51b743..55bd086f 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.282 2013/09/13 16:21:52 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.283 2014/02/13 12:11:34 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -185,9 +185,8 @@ static int luaB_collectgarbage (lua_State *L) { switch (o) { case LUA_GCCOUNT: { int b = lua_gc(L, LUA_GCCOUNTB, 0); - lua_pushnumber(L, res + ((lua_Number)b/1024)); - lua_pushinteger(L, b); - return 2; + lua_pushnumber(L, (lua_Number)res + ((lua_Number)b/1024)); + return 1; } case LUA_GCSTEP: case LUA_GCISRUNNING: { lua_pushboolean(L, res); -- cgit v1.2.3-55-g6feb