ObjectPool<T> class
Generic object pool for recycling objects
Constructors
- ObjectPool({required T factory(), void resetFn(T)?, int maxPoolSize = 1000})
-
Creates a new object pool
factory: Function to create new instancesresetFn: Optional function to reset object state for reusemaxPoolSize: Maximum objects to keep in pool (default: 1000)
Properties
Methods
-
acquire(
) → T - Acquire an object from the pool or create a new one
-
clear(
) → void - Clear all pooled objects
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
T object) → void - Release an object back to the pool for reuse
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited