using Misaki.HighPerformance.Buffer; namespace Ghost.Core.Utilities; public class CollectionPool where TCollection : class, ICollection, new() { internal static readonly ObjectPool s_pool = new ObjectPool(() => new TCollection(), 1); public static TCollection Rent() { return s_pool.Rent(); } public static void Return(TCollection collection) { collection.Clear(); s_pool.Return(collection); } } public class ListPool : CollectionPool, T>;