/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{MemCachePool as e}from"../../../../../core/MemCachePool.js";class t{constructor(t,c,r){this._create=c,this._cache=new e(t,r)}dispose(){this._cache.destroy()}newBuffer(e){const t=e.toString();let c=this._cache.pop(t);return c||(c=this._create(e),c)}deleteBuffer(e){if(null==e)return;const t=e.sizeBytes.toString();this._cache.put(t,e)}}export{t as BufferCache};
