4 writes to _rentedBuffer
Microsoft.AspNetCore.Components.Server (4)
src\Shared\PooledArrayBufferWriter.cs (4)
19
_rentedBuffer
= ArrayPool<T>.Shared.Rent(MinimumBufferSize);
27
_rentedBuffer
= ArrayPool<T>.Shared.Rent(initialCapacity);
96
_rentedBuffer
= null;
163
_rentedBuffer
= ArrayPool<T>.Shared.Rent(newSize);
21 references to _rentedBuffer
Microsoft.AspNetCore.Components.Server (21)
src\Shared\PooledArrayBufferWriter.cs (21)
37
return
_rentedBuffer
.AsMemory(0, _index);
57
return
_rentedBuffer
.Length;
67
return
_rentedBuffer
.Length - _index;
80
Debug.Assert(
_rentedBuffer
!= null);
82
_rentedBuffer
.AsSpan(0, _index).Clear();
89
if (
_rentedBuffer
== null)
95
ArrayPool<T>.Shared.Return(
_rentedBuffer
);
101
if (
_rentedBuffer
== null)
118
if (_index >
_rentedBuffer
.Length - count)
120
ThrowInvalidOperationException(
_rentedBuffer
.Length);
131
return
_rentedBuffer
.AsMemory(_index);
139
return
_rentedBuffer
.AsSpan(_index);
144
Debug.Assert(
_rentedBuffer
!= null);
153
var availableSpace =
_rentedBuffer
.Length - _index;
157
var growBy = Math.Max(sizeHint,
_rentedBuffer
.Length);
159
var newSize = checked(
_rentedBuffer
.Length + growBy);
161
var oldBuffer =
_rentedBuffer
;
166
Debug.Assert(
_rentedBuffer
.Length >= _index);
169
previousBuffer.CopyTo(
_rentedBuffer
);
174
Debug.Assert(
_rentedBuffer
.Length - _index > 0);
175
Debug.Assert(
_rentedBuffer
.Length - _index >= sizeHint);