* 清空池
()
| 109 | * 清空池 |
| 110 | */ |
| 111 | public clear(): void { |
| 112 | // 重置所有对象 |
| 113 | for (const obj of this._objects) { |
| 114 | obj.reset(); |
| 115 | } |
| 116 | |
| 117 | this._objects.length = 0; |
| 118 | this._stats.size = 0; |
| 119 | this._updateMemoryUsage(); |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * 压缩池(移除多余的对象) |
nothing calls this directly
no test coverage detected