charm/tests/utils/collect.luau
2024-10-12 16:08:36 -07:00

12 lines
240 B
Text

--[=[
Trigger a garbage collection cycle by allocating a large amount of junk memory
and then waiting for the next frame.
]=]
local function collect()
for _ = 1, 1e4 do
local _ = table.create(1e3)
end
task.wait()
end
return collect