getgc
function getgc(include_tables: boolean?): { { any } | (...any) -> (...any) | userdata }Parameters
Examples
local DummyTable = {}
local function DummyFunction() end
task.wait(0.05) -- Step a bit
for GarbageIndex, GarbageValue in pairs(getgc()) do
if GarbageValue == DummyFunction then
print(`Found function: {DummyFunction}`)
elseif GarbageValue == DummyTable then
print(`Found table?: {DummyTable}`) -- This shouldn't print
end
endLast updated