System.Net.ScatterGatherBuffers.AllocateMemoryChunk C# (CSharp) Method

AllocateMemoryChunk() private method

private AllocateMemoryChunk ( int newSize ) : MemoryChunk
newSize int
return MemoryChunk
        private MemoryChunk AllocateMemoryChunk(int newSize) {
            if (newSize > nextChunkLength) {
                nextChunkLength = newSize;
            }
            MemoryChunk newChunk = new MemoryChunk(nextChunkLength);
            if (Empty) {
                headChunk = newChunk;
            }
            //
            // next time allocate twice as much. check fot possible overflows
            //
            nextChunkLength *= 2;
            //
            // update number of chunks in the linked list
            //
            chunkCount++;
            GlobalLog.Print("ScatterGatherBuffers#" + ValidationHelper.HashString(this) + "::AllocateMemoryChunk() chunkCount:" + chunkCount.ToString() + " nextChunkLength:" + nextChunkLength.ToString());
            return newChunk;
        }