/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../chunks/_rollupPluginBabelHelpers","../support/AllocationTracer","./enums"],(function(t,e,n,r){"use strict";const o={RECORD_ALLOCATIONS:!1};let s=function(){function t(){for(this._current=new Array,this._max=new Array,this._allocations=new n.AllocationTracer(o.RECORD_ALLOCATIONS);this._current.length<r.ResourceType.COUNT;)this._current.push(0),this._max.push(0)}var s=t.prototype;return s.resetMax=function(){for(this._max.length=0;this._max.length<this._current.length;)this._max.push(0)},s.increment=function(t,e){const n=++this._current[t];this._max[t]=Math.max(n,this._max[t]),this._allocations.add(e)},s.decrement=function(t,e){--this._current[t],this._allocations.remove(e)},s.printResourceCount=function(){if(this.total>0){console.log("Live objects:");for(let t=0;t<r.ResourceType.COUNT;++t){const e=this._current[t];e>0&&console.log(`${r.ResourceType[t]}: ${e}`)}}this._allocations.print()},e._createClass(t,[{key:"max",get:function(){return this._max}},{key:"current",get:function(){return this._current}},{key:"total",get:function(){return this.current.reduce(((t,e)=>t+e),0)}}]),t}();t.InstanceCounter=s,t.test=o,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
