From 1537d6680bb66dc2484e11815bc2cd0e31ca39cc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Feb 2021 11:41:02 -0300 Subject: New control for reentrancy of emergency collections Instead of assuming that shrinking a block may be an emergency collection, use an explicit field ('gcstopem') to stop emergency collections while GC is working. --- testes/gc.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testes') diff --git a/testes/gc.lua b/testes/gc.lua index 80850f92..2332c939 100644 --- a/testes/gc.lua +++ b/testes/gc.lua @@ -676,6 +676,14 @@ end -- just to make sure assert(collectgarbage'isrunning') +do -- check that the collector is reentrant in incremental mode + setmetatable({}, {__gc = function () + collectgarbage() + end}) + collectgarbage() +end + + collectgarbage(oldmode) print('OK') -- cgit v1.2.3-55-g6feb