From 258355734d3aceb34eb6288ece37d9bbd7f2bc6d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 21 Oct 2024 15:18:20 -0300 Subject: Better support in 'ltests' for tracing the GC --- testes/api.lua | 2 +- testes/gc.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'testes') diff --git a/testes/api.lua b/testes/api.lua index ae2f82dd..b7e34f7f 100644 --- a/testes/api.lua +++ b/testes/api.lua @@ -799,7 +799,7 @@ assert(debug.getuservalue(b) == 134) -- test barrier for uservalues do local oldmode = collectgarbage("incremental") - T.gcstate("atomic") + T.gcstate("enteratomic") assert(T.gccolor(b) == "black") debug.setuservalue(b, {x = 100}) T.gcstate("pause") -- complete collection diff --git a/testes/gc.lua b/testes/gc.lua index 3f8143b1..09bfe09a 100644 --- a/testes/gc.lua +++ b/testes/gc.lua @@ -560,8 +560,8 @@ if T then -- tests for weird cases collecting upvalues -- create coroutine in a weak table, so it will never be marked t.co = coroutine.wrap(foo) local f = t.co() -- create function to access local 'a' - T.gcstate("atomic") -- ensure all objects are traversed - assert(T.gcstate() == "atomic") + T.gcstate("enteratomic") -- ensure all objects are traversed + assert(T.gcstate() == "enteratomic") assert(t.co() == 100) -- resume coroutine, creating new table for 'a' assert(T.gccolor(t.co) == "white") -- thread was not traversed T.gcstate("pause") -- collect thread, but should mark 'a' before that @@ -574,7 +574,7 @@ if T then -- tests for weird cases collecting upvalues collectgarbage() collectgarbage"stop" local a = {} -- avoid 'u' as first element in 'allgc' - T.gcstate"atomic" + T.gcstate"enteratomic" T.gcstate"sweepallgc" local x = {} assert(T.gccolor(u) == "black") -- userdata is "old" (black) -- cgit v1.2.3-55-g6feb