public static void Dealloc(ref ByteBuffer buffer)
{
if (null == buffer)
{
return;
}
int size = buffer.Data.Length;
if (0 == size || 0 != (size & (size - 1)))
{
return;
}
if (size > (1 << maxSizePOT))
{
return;
}
List <ByteBuffer> pool = sPool[sIndexLookup[size]];
int slots = AvailableSlots(pool);
if (slots < pool.Count)
{
buffer.Reset();
pool[slots] = buffer;
buffer = null;
}
}