Class ListPool
Lightweight List Pool.
Handy class for pooling lists of type T.
Usage:
Claim a new list using
List<SomeClass> foo = ListPool<SomeClass>.Claim ();
Use it and do stuff with it
Release it with
ListPool<SomeClass>.Release (foo);
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.
Version 3.2
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.
Private/Protected Members
When requesting a list with a specified capacity, search max this many lists in the pool before giving up.
Internal pool.