diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-26 11:41:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-26 11:41:02 -0300 |
commit | 1537d6680bb66dc2484e11815bc2cd0e31ca39cc (patch) | |
tree | f035f9e28fa2f1a6fba62e1b25d32b8a4b824204 /testes | |
parent | e0260eb2d4085723302d637dd8f3fca339d18817 (diff) | |
download | lua-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.lua | 8 |
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 |
677 | assert(collectgarbage'isrunning') | 677 | assert(collectgarbage'isrunning') |
678 | 678 | ||
679 | do -- check that the collector is reentrant in incremental mode | ||
680 | setmetatable({}, {__gc = function () | ||
681 | collectgarbage() | ||
682 | end}) | ||
683 | collectgarbage() | ||
684 | end | ||
685 | |||
686 | |||
679 | collectgarbage(oldmode) | 687 | collectgarbage(oldmode) |
680 | 688 | ||
681 | print('OK') | 689 | print('OK') |