aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-08-04 15:20:18 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-08-04 15:20:18 -0300
commit323f33d0148a385e98a15a2ad00c41d40c9f297b (patch)
tree098402665e0777ca5abcd03879d5de230a687490
parent55dc7fb240d145b9e44380ab478e55c668a6797a (diff)
downloadlua-323f33d0148a385e98a15a2ad00c41d40c9f297b.tar.gz
lua-323f33d0148a385e98a15a2ad00c41d40c9f297b.tar.bz2
lua-323f33d0148a385e98a15a2ad00c41d40c9f297b.zip
'collectgarbage"count"' returns a second argument with the count%1024.
-rw-r--r--lbaselib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 96e26a9a..edd72dcd 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.216 2009/07/08 16:06:07 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.217 2009/07/15 17:35:20 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*/
@@ -194,7 +194,8 @@ static int luaB_collectgarbage (lua_State *L) {
194 case LUA_GCCOUNT: { 194 case LUA_GCCOUNT: {
195 int b = lua_gc(L, LUA_GCCOUNTB, 0); 195 int b = lua_gc(L, LUA_GCCOUNTB, 0);
196 lua_pushnumber(L, res + ((lua_Number)b/1024)); 196 lua_pushnumber(L, res + ((lua_Number)b/1024));
197 return 1; 197 lua_pushinteger(L, b);
198 return 2;
198 } 199 }
199 case LUA_GCSTEP: { 200 case LUA_GCSTEP: {
200 lua_pushboolean(L, res); 201 lua_pushboolean(L, res);