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