diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-12-13 10:41:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-12-13 10:41:17 -0300 |
commit | 0bfc572e51d9035a615ef6e9523f736c9ffa8e57 (patch) | |
tree | 218f2bb13a873becf8fa657a296c8863f7e0e466 /lgc.h | |
parent | 1de95e97ef65632a88e08b6184bd9d1ceba7ec2f (diff) | |
download | lua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.tar.gz lua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.tar.bz2 lua-0bfc572e51d9035a615ef6e9523f736c9ffa8e57.zip |
Bug: GC is not reentrant
As the GC is not reentrant, finalizers should not be able to invoke it.
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -148,6 +148,15 @@ | |||
148 | */ | 148 | */ |
149 | #define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0) | 149 | #define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0) |
150 | 150 | ||
151 | |||
152 | /* | ||
153 | ** Control when GC is running: | ||
154 | */ | ||
155 | #define GCSTPUSR 1 /* bit true when GC stopped by user */ | ||
156 | #define GCSTPGC 2 /* bit true when GC stopped by itself */ | ||
157 | #define gcrunning(g) ((g)->gcstp == 0) | ||
158 | |||
159 | |||
151 | /* | 160 | /* |
152 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' | 161 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' |
153 | ** allows some adjustments to be done only when needed. macro | 162 | ** allows some adjustments to be done only when needed. macro |