lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 6a24bd17a8203394405005c1d63d08f0c7c25a27
parent 1cce3e6842fd76099b1973dabd8504566610f068
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri, 14 Feb 2014 14:45:13 -0200

no more second result from 'collectgarbage"count"' (as Lua seldom
will need lua_Number to be an integer)

Diffstat:
Mlbaselib.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 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);