Lines Matching refs:_buffer
47 private T[] _buffer; field in Google.Protobuf.Buffers.ArrayBufferWriter
58 _buffer = new T[0]; in ArrayBufferWriter()
81 _buffer = new T[initialCapacity]; in ArrayBufferWriter()
88 public ReadOnlyMemory<T> WrittenMemory => _buffer.AsMemory(0, _index);
93 public ReadOnlySpan<T> WrittenSpan => _buffer.AsSpan(0, _index);
103 public int Capacity => _buffer.Length;
108 public int FreeCapacity => _buffer.Length - _index;
118 Debug.Assert(_buffer.Length >= _index); in Clear()
119 _buffer.AsSpan(0, _index).Clear(); in Clear()
140 if (_index > _buffer.Length - count) in Advance()
165 Debug.Assert(_buffer.Length > _index); in GetMemory()
166 return _buffer.AsMemory(_index); in GetMemory()
188 Debug.Assert(_buffer.Length > _index); in GetSpan()
189 return _buffer.AsSpan(_index); in GetSpan()
204 int growBy = Math.Max(sizeHint, _buffer.Length); in CheckAndResizeBuffer()
206 if (_buffer.Length == 0) in CheckAndResizeBuffer()
217 int newSize = checked(_buffer.Length + growBy); in CheckAndResizeBuffer()
219 Array.Resize(ref _buffer, newSize); in CheckAndResizeBuffer()