public char[] RentBuffer(ArrayPoolApi_I <char> bufferPool, int minSize) { if (bufferPool == null) { return(new char[minSize]); } char[] buffer = bufferPool.Rent(minSize); return(buffer); }
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)); }