Constructs a new InstancePool.
PrivateclassClass-default pendingState snapshot per pool key (same string as get / _cacheKey).
Not stored on constructors — Roku function refs cannot hold expando properties.
PrivateclazzMaps class names to their constructors for instantiation.
PrivateinIn-use instances keyed by className then stable pool key (Record, not Set/Map).
PrivateinMonotonic id for pool keys when _hid is absent.
PrivatepoolThe pool of reusable instances, keyed by class name.
PrivateusedTracks the number of used instances for each class.
PrivatebuildPrivatecaptureOn the very first construction for a pool key, snapshot the pendingState produced by
@state / @layoutState field initialisers so that onWillReuse can restore
a recycled instance to its class-default state. Captured once per class name.
Retrieves an instance of the specified class from the pool or creates a new one if none are available.
The type of the reusable instance.
The name of the class to retrieve an instance for.
Optionalclazz: new () => TThe constructor of the class to instantiate if no instances are available in the pool.
An instance of the specified class.
Debug-only: instances classified as dangling (likely leak or inconsistent lifecycle).
Debug-only: snapshot of in-use instances per class (plain objects, JSON-safe).
Returns the counts of items in the pool for each class.
An object where the keys are class names and the values are the counts of items in the pool.
Prepopulates the pool with a specified number of items.
The class name to use as the key in the pool.
The class constructor to create new instances.
The number of items to create and add to the pool.
PrivateregisterPrivateunregister
InstancePool manages reusable object instances for performance and memory efficiency. Implements the IInstancePool interface.