From b719ff9399cbc4b19b2b8325417fc5fa0ef3d0e3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 1 Dec 2023 16:38:28 -0300 Subject: Removed parameter in 'collectgarbage("step")' A call to 'collectgarbage("step")' always performs one GC basic step. --- testes/gc.lua | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'testes') diff --git a/testes/gc.lua b/testes/gc.lua index 4cf7d556..d7e0c4ff 100644 --- a/testes/gc.lua +++ b/testes/gc.lua @@ -33,8 +33,7 @@ do for j = 1, #t do local m = t[j] collectgarbage("incremental", p, m) - collectgarbage("step", 0) - collectgarbage("step", 10000) + collectgarbage("step") end end -- restore original parameters @@ -169,45 +168,6 @@ do end --- --- test the "size" of basic GC steps (whatever they mean...) --- -do -print("steps") - - print("steps (2)") - - local function dosteps (siz) - collectgarbage() - local a = {} - for i=1,100 do a[i] = {{}}; local b = {} end - local x = gcinfo() - local i = 0 - repeat -- do steps until it completes a collection cycle - i = i+1 - until collectgarbage("step", siz) - assert(gcinfo() < x) - return i -- number of steps - end - - collectgarbage"stop" - - if not _port then - assert(dosteps(10) < dosteps(2)) - end - - -- collector should do a full collection with so many steps - assert(dosteps(20000) == 1) - assert(collectgarbage("step", 20000) == true) - assert(collectgarbage("step", 20000) == true) - - assert(not collectgarbage("isrunning")) - collectgarbage"restart" - assert(collectgarbage("isrunning")) - -end - - if not _port then -- test the pace of the collector collectgarbage(); collectgarbage() -- cgit v1.2.3-55-g6feb