MCPcopy Create free account
hub / github.com/esengine/esengine / setMaxSize

Method setMaxSize

packages/core/src/Utils/Pool/Pool.ts:162–170  ·  view source on GitHub ↗

* 设置最大池大小 * @param maxSize 新的最大大小

(maxSize: number)

Source from the content-addressed store, hash-verified

160 * @param maxSize 新的最大大小
161 */
162 public setMaxSize(maxSize: number): void {
163 this._maxSize = maxSize;
164 this._stats.maxSize = maxSize;
165
166 // 如果当前池大小超过新的最大值,进行压缩
167 if (this._objects.length > maxSize) {
168 this.compact(maxSize);
169 }
170 }
171
172 /**
173 * 获取池中可用对象数量

Callers

nothing calls this directly

Calls 1

compactMethod · 0.95

Tested by

no test coverage detected