Added a counter of the total number of existing objects
It may simplify the control of the garbage collector.
This commit is contained in:
1
lstate.h
1
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' */
|
||||
|
||||
Reference in New Issue
Block a user