diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-14 14:45:38 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-14 14:45:38 -0200 |
commit | 6a24bd17a8203394405005c1d63d08f0c7c25a27 (patch) | |
tree | 8ff72171a5c41d7854523dd531ea02c45175709f /lbaselib.c | |
parent | 1cce3e6842fd76099b1973dabd8504566610f068 (diff) | |
download | lua-6a24bd17a8203394405005c1d63d08f0c7c25a27.tar.gz lua-6a24bd17a8203394405005c1d63d08f0c7c25a27.tar.bz2 lua-6a24bd17a8203394405005c1d63d08f0c7c25a27.zip |
no more second result from 'collectgarbage"count"' (as Lua seldom
will need lua_Number to be an integer)
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.282 2013/09/13 16:21:52 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.283 2014/02/13 12:11:34 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -185,9 +185,8 @@ static int luaB_collectgarbage (lua_State *L) { | |||
185 | switch (o) { | 185 | switch (o) { |
186 | case LUA_GCCOUNT: { | 186 | case LUA_GCCOUNT: { |
187 | int b = lua_gc(L, LUA_GCCOUNTB, 0); | 187 | int b = lua_gc(L, LUA_GCCOUNTB, 0); |
188 | lua_pushnumber(L, res + ((lua_Number)b/1024)); | 188 | lua_pushnumber(L, (lua_Number)res + ((lua_Number)b/1024)); |
189 | lua_pushinteger(L, b); | 189 | return 1; |
190 | return 2; | ||
191 | } | 190 | } |
192 | case LUA_GCSTEP: case LUA_GCISRUNNING: { | 191 | case LUA_GCSTEP: case LUA_GCISRUNNING: { |
193 | lua_pushboolean(L, res); | 192 | lua_pushboolean(L, res); |