Bug: GC is not reentrant

As the GC is not reentrant, finalizers should not be able to invoke it.
This commit is contained in:
Roberto Ierusalimschy
2021-12-13 10:41:17 -03:00
parent 1de95e97ef
commit 0bfc572e51
9 changed files with 57 additions and 27 deletions

9
lgc.h
View File

@@ -148,6 +148,15 @@
*/
#define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0)
/*
** Control when GC is running:
*/
#define GCSTPUSR 1 /* bit true when GC stopped by user */
#define GCSTPGC 2 /* bit true when GC stopped by itself */
#define gcrunning(g) ((g)->gcstp == 0)
/*
** Does one step of collection when debt becomes positive. 'pre'/'pos'
** allows some adjustments to be done only when needed. macro