aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-13 15:45:57 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-13 15:45:57 -0300
commit5d8b5b9290c932bdfd7dcc670a5af957bdd58392 (patch)
tree17915e03d62517c47ddf3dd7db6c07596f8d5748 /lstate.h
parent40565b4a089f44fdcb16f4ed0080b0ca3755e4aa (diff)
downloadlua-5d8b5b9290c932bdfd7dcc670a5af957bdd58392.tar.gz
lua-5d8b5b9290c932bdfd7dcc670a5af957bdd58392.tar.bz2
lua-5d8b5b9290c932bdfd7dcc670a5af957bdd58392.zip
Changed signal of GC debt
Positive debts seems more natural then negative ones.
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lstate.h b/lstate.h
index c290ff32..1aef2f75 100644
--- a/lstate.h
+++ b/lstate.h
@@ -251,8 +251,8 @@ typedef struct global_State {
251 lua_Alloc frealloc; /* function to reallocate memory */ 251 lua_Alloc frealloc; /* function to reallocate memory */
252 void *ud; /* auxiliary data to 'frealloc' */ 252 void *ud; /* auxiliary data to 'frealloc' */
253 lu_mem totalbytes; /* number of bytes currently allocated */ 253 lu_mem totalbytes; /* number of bytes currently allocated */
254 l_obj totalobjs; /* total number of objects allocated - GCdebt */ 254 l_obj totalobjs; /* total number of objects allocated + GCdebt */
255 l_obj GCdebt; /* bytes allocated not yet compensated by the collector */ 255 l_obj GCdebt; /* objects counted but not yet allocated */
256 l_obj marked; /* number of objects marked in a GC cycle */ 256 l_obj marked; /* number of objects marked in a GC cycle */
257 l_obj GClastmajor; /* objects at last major collection */ 257 l_obj GClastmajor; /* objects at last major collection */
258 stringtable strt; /* hash table for strings */ 258 stringtable strt; /* hash table for strings */
@@ -388,7 +388,7 @@ union GCUnion {
388 388
389 389
390/* actual number of total objects allocated */ 390/* actual number of total objects allocated */
391#define gettotalobjs(g) ((g)->totalobjs + (g)->GCdebt) 391#define gettotalobjs(g) ((g)->totalobjs - (g)->GCdebt)
392 392
393 393
394LUAI_FUNC void luaE_setdebt (global_State *g, l_obj debt); 394LUAI_FUNC void luaE_setdebt (global_State *g, l_obj debt);