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 /lstate.c | |
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 'lstate.c')
-rw-r--r-- | lstate.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -236,7 +236,7 @@ static void f_luaopen (lua_State *L, void *ud) { | |||
236 | luaS_init(L); | 236 | luaS_init(L); |
237 | luaT_init(L); | 237 | luaT_init(L); |
238 | luaX_init(L); | 238 | luaX_init(L); |
239 | g->gcrunning = 1; /* allow gc */ | 239 | g->gcstp = 0; /* allow gc */ |
240 | setnilvalue(&g->nilvalue); /* now state is complete */ | 240 | setnilvalue(&g->nilvalue); /* now state is complete */ |
241 | luai_userstateopen(L); | 241 | luai_userstateopen(L); |
242 | } | 242 | } |
@@ -373,7 +373,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
373 | g->ud_warn = NULL; | 373 | g->ud_warn = NULL; |
374 | g->mainthread = L; | 374 | g->mainthread = L; |
375 | g->seed = luai_makeseed(L); | 375 | g->seed = luai_makeseed(L); |
376 | g->gcrunning = 0; /* no GC while building state */ | 376 | g->gcstp = GCSTPGC; /* no GC while building state */ |
377 | g->strt.size = g->strt.nuse = 0; | 377 | g->strt.size = g->strt.nuse = 0; |
378 | g->strt.hash = NULL; | 378 | g->strt.hash = NULL; |
379 | setnilvalue(&g->l_registry); | 379 | setnilvalue(&g->l_registry); |