3 instantiations of BufferSegment
System.IO.Pipelines (3)
System\IO\Pipelines\Pipe.cs (1)
275return new BufferSegment();
System\IO\Pipelines\StreamPipeReader.cs (1)
550return new BufferSegment();
System\IO\Pipelines\StreamPipeWriter.cs (1)
191return new BufferSegment();
72 references to BufferSegment
System.IO.Pipelines (72)
System\IO\Pipelines\BufferSegment.cs (6)
14private BufferSegment? _next; 40public BufferSegment? NextSegment 107public void SetNext(BufferSegment segment) 125internal static long GetLength(BufferSegment startSegment, int startIndex, BufferSegment endSegment, int endIndex) 131internal static long GetLength(long startPosition, BufferSegment endSegment, int endIndex)
System\IO\Pipelines\BufferSegmentStack.cs (7)
25public bool TryPop([NotNullWhen(true)] out BufferSegment? result) 43public void Push(BufferSegment item) 61private void PushWithResize(BufferSegment item) 82private readonly BufferSegment _value; 83private SegmentAsValueType(BufferSegment value) => _value = value; 84public static implicit operator SegmentAsValueType(BufferSegment s) => new SegmentAsValueType(s); 85public static implicit operator BufferSegment(SegmentAsValueType s) => s._value;
System\IO\Pipelines\Pipe.cs (25)
66private BufferSegment? _readHead; 72private BufferSegment? _readTail; 77private BufferSegment? _writingHead; 181BufferSegment newSegment = AllocateSegment(sizeHint); 210BufferSegment newSegment = AllocateSegment(sizeHint); 220private BufferSegment AllocateSegment(int sizeHint) 222BufferSegment newSegment = CreateSegmentUnsynchronized(); 229private void RentMemory(BufferSegment segment, int sizeHint) 268private BufferSegment CreateSegmentUnsynchronized() 270if (_bufferSegmentPool.TryPop(out BufferSegment? segment)) 278private void ReturnSegmentUnsynchronized(BufferSegment segment) 461AdvanceReader((BufferSegment?)consumed.GetObject(), consumed.GetInteger(), (BufferSegment?)examined.GetObject(), examined.GetInteger()); 464private void AdvanceReader(BufferSegment? consumedSegment, int consumedIndex, BufferSegment? examinedSegment, int examinedIndex) 467if (consumedSegment != null && examinedSegment != null && BufferSegment.GetLength(consumedSegment, consumedIndex, examinedSegment, examinedIndex) < 0) 472BufferSegment? returnStart = null; 473BufferSegment? returnEnd = null; 489long examinedBytes = BufferSegment.GetLength(_lastExaminedIndex, examinedSegment, examinedIndex); 522BufferSegment? nextBlock = returnEnd!.NextSegment; 577BufferSegment? next = returnStart.NextSegment; 885BufferSegment? segment = _readHead ?? _readTail; 888BufferSegment returnSegment = segment; 968BufferSegment? head = _readHead; 1120BufferSegment newSegment = AllocateSegment(0);
System\IO\Pipelines\StreamPipeReader.cs (21)
21private BufferSegment? _readHead; 24private BufferSegment? _readTail; 90AdvanceTo((BufferSegment?)consumed.GetObject(), consumed.GetInteger(), (BufferSegment?)examined.GetObject(), examined.GetInteger()); 93private void AdvanceTo(BufferSegment? consumedSegment, int consumedIndex, BufferSegment? examinedSegment, int examinedIndex) 105BufferSegment returnStart = _readHead; 106BufferSegment? returnEnd = consumedSegment; 108long consumedBytes = BufferSegment.GetLength(returnStart, _readIndex, consumedSegment, consumedIndex); 139BufferSegment? nextBlock = returnEnd.NextSegment; 153BufferSegment next = returnStart.NextSegment!; 188BufferSegment? segment = _readHead; 191BufferSegment returnSegment = segment; 332BufferSegment? segment = _readHead; 403BufferSegment? segment = _readHead; 504BufferSegment nextSegment = AllocateSegment(minimumSize); 511private BufferSegment AllocateSegment(int? minimumSize = null) 513BufferSegment nextSegment = CreateSegmentUnsynchronized(); 543private BufferSegment CreateSegmentUnsynchronized() 545if (_bufferSegmentPool.TryPop(out BufferSegment? segment)) 553private void ReturnSegmentUnsynchronized(BufferSegment segment)
System\IO\Pipelines\StreamPipeWriter.cs (13)
19private BufferSegment? _head; 20private BufferSegment? _tail; 124BufferSegment newSegment = AllocateSegment(sizeHint); 144BufferSegment newSegment = AllocateSegment(sizeHint); 152private BufferSegment AllocateSegment(int sizeHint) 155BufferSegment newSegment = CreateSegmentUnsynchronized(); 184private BufferSegment CreateSegmentUnsynchronized() 186if (_bufferSegmentPool.TryPop(out BufferSegment? segment)) 194private void ReturnSegmentUnsynchronized(BufferSegment segment) 316BufferSegment? segment = _head; 319BufferSegment returnSegment = segment; 388BufferSegment? segment = _head; 391BufferSegment returnSegment = segment;