aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-26 11:41:02 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-26 11:41:02 -0300
commit1537d6680bb66dc2484e11815bc2cd0e31ca39cc (patch)
treef035f9e28fa2f1a6fba62e1b25d32b8a4b824204 /testes
parente0260eb2d4085723302d637dd8f3fca339d18817 (diff)
downloadlua-1537d6680bb66dc2484e11815bc2cd0e31ca39cc.tar.gz
lua-1537d6680bb66dc2484e11815bc2cd0e31ca39cc.tar.bz2
lua-1537d6680bb66dc2484e11815bc2cd0e31ca39cc.zip
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.
Diffstat (limited to 'testes')
-rw-r--r--testes/gc.lua8
1 files changed, 8 insertions, 0 deletions
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
676-- just to make sure 676-- just to make sure
677assert(collectgarbage'isrunning') 677assert(collectgarbage'isrunning')
678 678
679do -- check that the collector is reentrant in incremental mode
680 setmetatable({}, {__gc = function ()
681 collectgarbage()
682 end})
683 collectgarbage()
684end
685
686
679collectgarbage(oldmode) 687collectgarbage(oldmode)
680 688
681print('OK') 689print('OK')