added manual gc early-outs if a collection finishes

This commit is contained in:
Max Cahill 2024-10-11 23:30:20 +11:00
parent 310af508bd
commit c573c79d32

View File

@ -48,7 +48,9 @@ return function(time_budget, memory_ceiling, disable_otherwise)
love.timer.getTime() - start_time < time_budget and love.timer.getTime() - start_time < time_budget and
steps < max_steps steps < max_steps
do do
collectgarbage("step", 1) if collectgarbage("step", 1) then
break
end
steps = steps + 1 steps = steps + 1
end end
--safety net --safety net