using System;
using System.Buffers;
namespace AlicizaX.ObjectPool
{
///
/// 数组池管理器,避免频繁分配数组
///
internal static class SlotArrayPool
{
private static readonly ArrayPool s_Pool = ArrayPool.Create(256, 50);
public static T[] Rent(int minimumLength)
{
return s_Pool.Rent(minimumLength);
}
public static void Return(T[] array, bool clearArray = false)
{
if (array != null)
s_Pool.Return(array, clearArray);
}
}
}