mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
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.
This commit is contained in:
parent
e0260eb2d4
commit
1537d6680b
5 changed files with 46 additions and 25 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue