Reusable
|
Note: This API is now obsolete.
[ObsoleteAttribute("It is not recommended to use this class because the need for pooling is rare and implementations of pooling can be dangerous.")] public static class ReusableObjectPool
The ReusableObjectPool type exposes the following members.
Name | Description | |
---|---|---|
Clear | Releases all the objects currently cached in the specified pool. | |
ReturnObject | Returns object to the pool. | |
SetPoolSize | Allocates the pool to the desired size. | |
TakeObject(Type) | Gets an object from the pool, or creates a new one if no pool items are available. | |
TakeObjectT(Type) | Gets an object from the pool, or creates a new one if no pool items are available. |
See ReusableObjectPoolT for more details on using object pooling.
ReusableObjectPool should be used when you only have the Type of an object available (such as when you are using reflection), otherwise you should use the generic ReusableObjectPoolT.