/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import"../../../core/has.js";import t from"../../../core/PooledArray.js";class o{constructor(t,o){this._factoryCallback=t,this._lengthCallback=o,this._pool=new Map}acquire(t){const o=this._pool.get(t);if(o&&0!==o.length)return o.pop();try{return this._factoryCallback(t)}catch(e){throw e}}release(o){const e=this._lengthCallback(o);let r=this._pool.get(e);r||(r=new t({shrink:!0}),this._pool.set(e,r)),r.push(o)}clear(){this._pool.clear()}get test(){}}export{o as BufferPool};
