From 76953316d1283ab6324b59b914ef53a521408444 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 3 Nov 2022 16:37:13 -0300 Subject: Added a counter of the total number of existing objects It may simplify the control of the garbage collector. --- lstate.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 2e907818..62ad61c6 100644 --- a/lstate.h +++ b/lstate.h @@ -250,6 +250,7 @@ typedef struct global_State { lua_Alloc frealloc; /* function to reallocate memory */ void *ud; /* auxiliary data to 'frealloc' */ l_mem totalbytes; /* number of bytes currently allocated - GCdebt */ + l_mem totalobjs; /* total number of objects allocated */ l_mem GCdebt; /* bytes allocated not yet compensated by the collector */ lu_mem GCestimate; /* an estimate of the non-garbage memory in use */ lu_mem lastatomic; /* see function 'genstep' in file 'lgc.c' */ -- cgit v1.2.3-55-g6feb