aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-20 17:40:07 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-20 17:40:07 -0200
commit551b076f1c7f9b66eecd8f6b7a12b1bd7a78b967 (patch)
treebde2f0e23706683829e87d4e239793de373444e7 /lapi.c
parent737f119187aca3c8f6743ec6e3cfc04e83723180 (diff)
downloadlua-551b076f1c7f9b66eecd8f6b7a12b1bd7a78b967.tar.gz
lua-551b076f1c7f9b66eecd8f6b7a12b1bd7a78b967.tar.bz2
lua-551b076f1c7f9b66eecd8f6b7a12b1bd7a78b967.zip
change in the relationship between totalbytes and GCdebt - luaM_realloc_
is too critical to update two counters
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lapi.c b/lapi.c
index b4dbc8ed..73cf1108 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.141 2010/11/26 14:32:31 roberto Exp roberto $ 2** $Id: lapi.c,v 2.142 2010/12/20 18:17:46 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -964,7 +964,7 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
964 break; 964 break;
965 } 965 }
966 case LUA_GCRESTART: { 966 case LUA_GCRESTART: {
967 g->GCdebt = 0; 967 luaE_setdebt(g, 0);
968 g->gcrunning = 1; 968 g->gcrunning = 1;
969 break; 969 break;
970 } 970 }
@@ -975,11 +975,11 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
975 } 975 }
976 case LUA_GCCOUNT: { 976 case LUA_GCCOUNT: {
977 /* GC values are expressed in Kbytes: #bytes/2^10 */ 977 /* GC values are expressed in Kbytes: #bytes/2^10 */
978 res = cast_int(g->totalbytes >> 10); 978 res = cast_int(gettotalbytes(g) >> 10);
979 break; 979 break;
980 } 980 }
981 case LUA_GCCOUNTB: { 981 case LUA_GCCOUNTB: {
982 res = cast_int(g->totalbytes & 0x3ff); 982 res = cast_int(gettotalbytes(g) & 0x3ff);
983 break; 983 break;
984 } 984 }
985 case LUA_GCSTEP: { 985 case LUA_GCSTEP: {