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