UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 641 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{MemCachePool as e}from"../../../core/MemCachePool.js";import{terrainAttributesLayout as r}from"./TerrainAttributes.js";class t{constructor(r){this._storage=new e(((e,t)=>r.newCache(e,t)),"TileGeometry")}acquire(e){const t=4,s=Math.ceil(e/t)*t,a=this._storage,c=o(s),i=a.pop(c);if(i)return i;const n=r.createBuffer(s);return n.release=()=>a.put(c,n),n}clear(){this._storage.clear()}destroy(){this._storage.destroy()}}function o(e){return e.toString()}export{t as TerrainAttributesCache};