# DictionaryPool<TKey, TValue>

> A version of CollectionPool<TCollection, TItem> for Dictionaries.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.Pool](/engine/6000.7/script-reference/unityengine/pool.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** CollectionPool\<Dictionary\<T, T>, KeyValuePair\<T, T>>

```csharp
public class DictionaryPool<TKey, TValue> : CollectionPool<Dictionary<TKey, TValue>, KeyValuePair<TKey, TValue>>
```

## Examples

```csharp
using UnityEngine.Pool;

public class Example
{
    void GetPooled()
    {
        // Get a pooled instance
        var instance = DictionaryPool<int, int>.Get();

        // Use the Dictionary

        // Return it back to the pool
        DictionaryPool<int, int>.Release(instance);
    }
}
```

## Inheritance

**Inherited Members:**

* CollectionPool\<Dictionary\<T, T>, KeyValuePair\<T, T>>.Get()
* CollectionPool\<Dictionary\<T, T>, KeyValuePair\<T, T>>.Get(Dictionary\<T, T>)
* CollectionPool\<Dictionary\<T, T>, KeyValuePair\<T, T>>.Release(Dictionary\<T, T>)
