语法
filtergc(filterType: string, options: table, firstOnly?: boolean): table参数
| 名称 | 类型 | 描述 |
|---|---|---|
filterType | string | 要匹配的垃圾收集器对象的类型。 |
options | table | 控制操作行为方式的可选设置表。 |
firstOnly? | boolean | 如果为 true,则仅返回第一个匹配的垃圾收集器对象。 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
matches | table | 与过滤器匹配的垃圾收集器对象的数组表。 |
说明
按类型和匹配选项过滤垃圾收集器对象。
使用 3 个参数调用: filterType, options, firstOnly。参数表会说明哪些值必填,哪些值只用于细化行为。
返回 matches (table)。使用返回表区分成功值、nil 结果和可恢复错误。
示例
使用占位值的示例调用。
local result = filtergc("example", {}, true)
print(result)