浏览代码

'collectgarbage"count"' returns a second argument with the count%1024.

Roberto Ierusalimschy 16 年之前
父节点
当前提交
323f33d014
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lbaselib.c

+ 3 - 2
lbaselib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lbaselib.c,v 1.216 2009/07/08 16:06:07 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.217 2009/07/15 17:35:20 roberto Exp roberto $
 ** Basic library
 ** See Copyright Notice in lua.h
 */
@@ -194,7 +194,8 @@ static int luaB_collectgarbage (lua_State *L) {
     case LUA_GCCOUNT: {
       int b = lua_gc(L, LUA_GCCOUNTB, 0);
       lua_pushnumber(L, res + ((lua_Number)b/1024));
-      return 1;
+      lua_pushinteger(L, b);
+      return 2;
     }
     case LUA_GCSTEP: {
       lua_pushboolean(L, res);