Changed signal of GC debt

Positive debts seems more natural then negative ones.
This commit is contained in:
Roberto Ierusalimschy
2022-12-13 15:45:57 -03:00
parent 40565b4a08
commit 5d8b5b9290
6 changed files with 22 additions and 25 deletions

View File

@@ -251,8 +251,8 @@ typedef struct global_State {
lua_Alloc frealloc; /* function to reallocate memory */
void *ud; /* auxiliary data to 'frealloc' */
lu_mem totalbytes; /* number of bytes currently allocated */
l_obj totalobjs; /* total number of objects allocated - GCdebt */
l_obj GCdebt; /* bytes allocated not yet compensated by the collector */
l_obj totalobjs; /* total number of objects allocated + GCdebt */
l_obj GCdebt; /* objects counted but not yet allocated */
l_obj marked; /* number of objects marked in a GC cycle */
l_obj GClastmajor; /* objects at last major collection */
stringtable strt; /* hash table for strings */
@@ -388,7 +388,7 @@ union GCUnion {
/* actual number of total objects allocated */
#define gettotalobjs(g) ((g)->totalobjs + (g)->GCdebt)
#define gettotalobjs(g) ((g)->totalobjs - (g)->GCdebt)
LUAI_FUNC void luaE_setdebt (global_State *g, l_obj debt);