Class ListPool

Public

Lightweight List Pool.

Handy class for pooling lists of type T.

Usage:

  • Claim a new list usingList<SomeClass> foo = ListPool<SomeClass>.Claim ();

  • Use it and do stuff with it

  • Release it withListPool<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.

Since

Version 3.2

See

Pathfinding.Util.StackPool

Public Static Methods

Claim ([...])

Claim a list...

Clear ()

Clears the pool for lists of this type.

GetSize ()

Number of lists of this type in the pool.

Release (list)

Releases a list...

Warmup (count, size)

Makes sure the pool contains at least count pooled items with capacity size.

Private/Protected Members

FindCandidate (pool, capacity)
LargeThreshold
Private Static
MaxCapacitySearchLength

When requesting a list with a specified capacity, search max this many lists in the pool before giving up.

Private Static
MaxLargePoolSize
Private Static
inPool
Private Static Readonly
largePool
Private Static Readonly
pool

Internal pool.

Private Static Readonly