File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ abstract class _AllocationPool<T> {
177177 _pool.add (item);
178178 }
179179
180+ /// Executes [fn] and provides a pool item in the callback.
181+ /// The item will be released to the pool after [fn] completes.
180182 R withPoolItem <R >({
181183 required R Function (T array) fn,
182184 }) {
@@ -186,6 +188,9 @@ abstract class _AllocationPool<T> {
186188 return r;
187189 }
188190
191+ /// Executes [fn] and provides a getter function that can be used to
192+ /// acquire new pool items while the [fn] is being executed. The
193+ /// acquired items will be released back to the pool after [fn] completes.
189194 R withItemGetter <R >(R Function (T Function () itemFn) fn) {
190195 List <T >? items;
191196 T itemFn () {
You can’t perform that action at this time.
0 commit comments