Ejemplo n.º 1
0
        public char[] EnsureBufferSize(ArrayPoolApi_I <char> bufferPool, int size, char[] buffer)
        {
            if (bufferPool == null)
            {
                return(new char[size]);
            }

            if (buffer != null)
            {
                bufferPool.Return(buffer);
            }

            return(bufferPool.Rent(size));
        }
Ejemplo n.º 2
0
 public void ReturnBuffer(ArrayPoolApi_I <char> bufferPool, char[] buffer)
 {
     bufferPool?.Return(buffer);
 }