3 writes to _index
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (3)
src\Shared\Buffers\RefPooledArrayBufferWriter.cs (3)
30
_index
= 0;
40
_index
= -1;
110
_index
+= count;
16 references to _index
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (16)
src\Shared\Buffers\RefPooledArrayBufferWriter.cs (16)
56
Debug.Assert(
_index
>= 0);
57
return _buffer.Slice(0,
_index
);
84
Debug.Assert(
_index
>= 0);
87
return _buffer.Slice(
_index
);
99
Debug.Assert(
_index
>= 0);
105
if (
_index
+ count > _buffer.Length)
107
throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {
_index
}, Capacity: {_buffer.Length}, Requested advance: {count}.");
127
var bufferSpace = _buffer.Length -
_index
;
137
Debug.Assert(_rentedBuffer.Length -
_index
> 0);
138
Debug.Assert(_rentedBuffer.Length -
_index
>= sizeHint);
144
var availableSpace = _buffer.Length -
_index
;
157
Debug.Assert(oldBuffer.Length >=
_index
);
158
Debug.Assert(_rentedBuffer.Length >=
_index
);
160
var previousBuffer = oldBuffer.AsSpan(0,
_index
);
166
Debug.Assert(_rentedBuffer.Length -
_index
> 0);
167
Debug.Assert(_rentedBuffer.Length -
_index
>= sizeHint);