ResourcePoolsT Class |
Namespace: DigitalRune
The ResourcePoolsT type exposes the following members.
Name | Description | |
---|---|---|
HashSets |
A resource pool containing collections of type HashSetT.
| |
Lists |
A resource pool containing collections of type ListT.
| |
Stacks |
A resource pool containing collections of type StackT.
|
Please read ResourcePoolT first, to learn more about resource pooling. The static class ResourcePoolsT provides global pools for collections that are frequently used in the DigitalRune applications and libraries, but they can also be used in your application to avoid unnecessary memory allocations.
New resource pools may be added to ResourcePoolsT in future releases of the DigitalRune libraries.
Thread-Safety: It is safe to access the resource pool from multiple threads simultaneously.
// Obtain an empty list from the global resource pool. List<string> list = ResourcePools<string>.Lists.Obtain(); // Do something with the list. // After use, recycle the list. (Note: It is not necessary to clear the list before // recycling. This will be handled automatically.) ResourcePools<string>.Lists.Recycle(list); list = null;