4 writes to _buffer
Microsoft.Extensions.Caching.Hybrid (4)
Internal\RecyclableArrayBufferWriter.cs (4)
60
_buffer
= [];
73
_buffer
= [];
141
_buffer
= [];
190
_buffer
= ArrayPool<T>.Shared.Rent(newSize);
14 references to _buffer
Microsoft.Extensions.Caching.Hybrid (14)
Internal\RecyclableArrayBufferWriter.cs (14)
47
public int FreeCapacity =>
_buffer
.Length - _index;
72
var tmp =
_buffer
;
87
if (_index >
_buffer
.Length - count)
114
public ReadOnlyMemory<T> GetCommittedMemory() => new(
_buffer
, 0, _index); // could also directly expose a ReadOnlySpan<byte> if useful
119
Debug.Assert(
_buffer
.Length > _index, "should have some space");
120
return
_buffer
.AsMemory(_index);
126
Debug.Assert(
_buffer
.Length > _index, "should have some space");
127
return
_buffer
.AsSpan(_index);
131
public T[] ToArray() =>
_buffer
.AsSpan(0, _index).ToArray();
138
var tmp = _index == 0 ? [] :
_buffer
;
150
return _index == 0 ? [] :
_buffer
;
162
var currentLength =
_buffer
.Length;
189
var oldArray =
_buffer
;
191
oldArray.AsSpan(0, _index).CopyTo(
_buffer
);