acquire method

T acquire()

Hands out a reusable T — an existing free one if available, otherwise a freshly created one. Always succeeds; maxCapacity bounds what release retains, not what acquire can hand out.

Implementation

T acquire() {
  final item = _free.isNotEmpty ? _free.removeLast() : _createNew();
  _active.add(item);
  if (_active.length > _peakActive) _peakActive = _active.length;
  return item;
}