Environment

filtergc

按类型和匹配选项过滤垃圾收集器对象。

语法

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

参数

名称类型描述
filterTypestring要匹配的垃圾收集器对象的类型。
optionstable控制操作行为方式的可选设置表。
firstOnly?boolean如果为 true,则仅返回第一个匹配的垃圾收集器对象。

返回值

名称类型描述
matchestable与过滤器匹配的垃圾收集器对象的数组表。

说明

按类型和匹配选项过滤垃圾收集器对象。

使用 3 个参数调用: filterType, options, firstOnly。参数表会说明哪些值必填,哪些值只用于细化行为。

返回 matches (table)。使用返回表区分成功值、nil 结果和可恢复错误。

示例

使用占位值的示例调用。

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