After a "bad collections", avoid switching back back to generational
After a major bad collection (one that collects too few objects), next collection will be major again. In that case, avoid switching back to generational mode (as it will have to switch again to incremental to do next major collection).
This commit is contained in:
@@ -11,6 +11,12 @@ collectgarbage()
|
||||
|
||||
local oldmode = collectgarbage("incremental")
|
||||
|
||||
-- changing modes should return previous mode
|
||||
assert(collectgarbage("generational") == "incremental")
|
||||
assert(collectgarbage("generational") == "generational")
|
||||
assert(collectgarbage("incremental") == "generational")
|
||||
assert(collectgarbage("incremental") == "incremental")
|
||||
|
||||
|
||||
local function gcinfo ()
|
||||
return collectgarbage"count" * 1024
|
||||
|
||||
Reference in New Issue
Block a user