using System; using System.Collections.Generic; namespace XUtliPoolLib { public class DictionaryPool { private static readonly ObjectPool> s_Pool = new ObjectPool>(new ObjectPool>.CreateObj(DictionaryPool.Create), delegate(Dictionary l) { l.Clear(); }, delegate(Dictionary l) { l.Clear(); }); public static Dictionary Create() { return new Dictionary(); } public static Dictionary Get() { return DictionaryPool.s_Pool.Get(); } public static void Release(Dictionary toRelease) { DictionaryPool.s_Pool.Release(toRelease); } } }