Environment

filtergc

Filters garbage collector objects by type and matching options.

Syntax

filtergc(filterType: string, options: table, firstOnly?: boolean): table

Arguments

NameTypeDescription
filterTypestringType of garbage collector object to match.
optionstableOptional settings table that controls how the operation behaves.
firstOnly?booleanWhen true, returns only the first matching garbage collector object.

Returns

NameTypeDescription
matchestableArray table of garbage collector objects that matched the filter.

Description

Filters garbage collector objects by type and matching options.

Call it with 3 parameter(s): filterType, options, firstOnly. The argument table explains which values are required and which ones only refine the behavior.

It returns matches (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = filtergc("example", {}, true)
print(result)