Lightweight List Pool.
Handy class for pooling lists of type T.
Claim a new list using
List<SomeClass> foo = ListPool<SomeClass>.Claim ();
Use it and do stuff with it
Release it with
You do not need to clear the list before releasing it. After you have released a list, you should never use it again, if you do use it, you will mess things up quite badly in the worst case.
Public Static Methods
Claim a list.
Claim a list with minimum capacity Returns a pooled list if any are in the pool.
Clears the pool for lists of this type.
Number of lists of this type in the pool.
Releases a list and sets the variable to null.
Releases a list.
Makes sure the pool contains at least count pooled items with capacity size.
When requesting a list with a specified capacity, search max this many lists in the pool before giving up.