5 writes to _index
Microsoft.Extensions.Caching.Hybrid (5)
Internal\RecyclableArrayBufferWriter.cs (5)
61_index = 0; 69_index = 0; 97_index += count; 111_index = 0; 142_index = 0;
16 references to _index
Microsoft.Extensions.Caching.Hybrid (16)
Internal\RecyclableArrayBufferWriter.cs (16)
46public int CommittedBytes => _index; 47public int FreeCapacity => _buffer.Length - _index; 53Debug.Assert(obj._index == 0, "index should be zero initially"); 87if (_index > _buffer.Length - count) 92if (_index + count > _maxLength) 114public ReadOnlyMemory<T> GetCommittedMemory() => new(_buffer, 0, _index); // could also directly expose a ReadOnlySpan<byte> if useful 119Debug.Assert(_buffer.Length > _index, "should have some space"); 120return _buffer.AsMemory(_index); 126Debug.Assert(_buffer.Length > _index, "should have some space"); 127return _buffer.AsSpan(_index); 131public T[] ToArray() => _buffer.AsSpan(0, _index).ToArray(); 138var tmp = _index == 0 ? [] : _buffer; 139length = _index; 149length = _index; 150return _index == 0 ? [] : _buffer; 191oldArray.AsSpan(0, _index).CopyTo(_buffer);