Class ObjectPoolSimple< T >

Public

Lightweight object Pool.

Handy class for pooling objects of type T.

Usage:

  • Claim a new object using SomeClass foo = ObjectPool<SomeClass>.Claim ();

  • Use it and do stuff with it

  • Release it with ObjectPool<SomeClass>.Release (foo);

After you have released a object, you should never use it again.

Since

Version 3.2

Version

Since 3.7.6 this class is thread safe

See

Pathfinding.Util.ListPool

ObjectPool

Public Static Methods

Claim ()

Claim a object.

Public Static
Clear ()

Clears the pool for objects of this type.

Public Static
GetSize ()

Number of objects of this type in the pool.

Public Static
Release (obj)

Releases an object.

Public Static

Private/Protected Members

inPool
Private Static Readonly
pool

Internal pool.

Private Static