diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-07-04 13:33:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-07-04 13:33:17 -0300 |
commit | bde17a419dd89763f584d3aa10e4f1d19f12b9d1 (patch) | |
tree | cb2a43f9212254c556a874a6b146a7ec422f53d1 | |
parent | 8950e0c049cc51025d501453b85f501b15c5317a (diff) | |
download | lua-bde17a419dd89763f584d3aa10e4f1d19f12b9d1.tar.gz lua-bde17a419dd89763f584d3aa10e4f1d19f12b9d1.tar.bz2 lua-bde17a419dd89763f584d3aa10e4f1d19f12b9d1.zip |
because of debt, 'totalbytes' can be negative (and therefore its
type must be signed)
-rw-r--r-- | lstate.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.121 2015/04/10 17:56:25 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.122 2015/06/01 16:34:37 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -109,7 +109,7 @@ typedef struct CallInfo { | |||
109 | typedef struct global_State { | 109 | typedef struct global_State { |
110 | lua_Alloc frealloc; /* function to reallocate memory */ | 110 | lua_Alloc frealloc; /* function to reallocate memory */ |
111 | void *ud; /* auxiliary data to 'frealloc' */ | 111 | void *ud; /* auxiliary data to 'frealloc' */ |
112 | lu_mem totalbytes; /* number of bytes currently allocated - GCdebt */ | 112 | l_mem totalbytes; /* number of bytes currently allocated - GCdebt */ |
113 | l_mem GCdebt; /* bytes allocated not yet compensated by the collector */ | 113 | l_mem GCdebt; /* bytes allocated not yet compensated by the collector */ |
114 | lu_mem GCmemtrav; /* memory traversed by the GC */ | 114 | lu_mem GCmemtrav; /* memory traversed by the GC */ |
115 | lu_mem GCestimate; /* an estimate of the non-garbage memory in use */ | 115 | lu_mem GCestimate; /* an estimate of the non-garbage memory in use */ |
@@ -212,7 +212,7 @@ union GCUnion { | |||
212 | 212 | ||
213 | 213 | ||
214 | /* actual number of total bytes allocated */ | 214 | /* actual number of total bytes allocated */ |
215 | #define gettotalbytes(g) ((g)->totalbytes + (g)->GCdebt) | 215 | #define gettotalbytes(g) cast(lu_mem, (g)->totalbytes + (g)->GCdebt) |
216 | 216 | ||
217 | LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); | 217 | LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); |
218 | LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); | 218 | LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); |