16 writes to _size
System.Private.CoreLib (16)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (2)
111list._size += source.Length; 154list._size += source.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (13)
77_size = count; 203_size = size + 1; 219_size = size + 1; 261_size += count; 326_size = 0; 334_size = 0; 376list._size = _size; 692list._size = count; 786_size++; 847_size += count; 994_size = freeIndex; 1007_size--; 1037_size -= count;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
135list._size = count;
97 references to _size
System.Private.CoreLib (97)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (9)
105if (list._items.Length - list._size < source.Length) 107list.Grow(checked(list._size + source.Length)); 110source.CopyTo(list._items.AsSpan(list._size)); 130if ((uint)index > (uint)list._size) 137if (list._items.Length - list._size < source.Length) 139list.Grow(checked(list._size + source.Length)); 145if (index < list._size) 147Array.Copy(list._items, index, list._items, index + source.Length, list._size - index); 172new ReadOnlySpan<T>(list._items, 0, list._size).CopyTo(destination);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (85)
102if (value < _size) 112if (_size > 0) 114Array.Copy(_items, newItems, _size); 127public int Count => _size; 148if ((uint)index >= (uint)_size) 157if ((uint)index >= (uint)_size) 200int size = _size; 216Debug.Assert(_size == _items.Length); 217int size = _size; 255if (_items.Length - _size < count) 257Grow(checked(_size + count)); 260c.CopyTo(_items, _size); 306if (_size - index < count) 325int size = _size; 352return _size != 0 && IndexOf(item) >= 0; 371List<TOutput> list = new List<TOutput>(_size); 372for (int i = 0; i < _size; i++) 376list._size = _size; 397Array.Copy(_items, 0, array!, arrayIndex, _size); 411if (_size - index < count) 423Array.Copy(_items, 0, array, arrayIndex, _size); 468int requiredCapacity = checked(_size + insertionCount); 479if (_size != indexToInsert) 481Array.Copy(_items, indexToInsert, newItems, indexToInsert + insertionCount, _size - indexToInsert); 515for (int i = 0; i < _size; i++) 533for (int i = 0; i < _size; i++) 544=> FindIndex(0, _size, match); 547=> FindIndex(startIndex, _size - startIndex, match); 551if ((uint)startIndex > (uint)_size) 556if (count < 0 || startIndex > _size - count) 581for (int i = _size - 1; i >= 0; i--) 592=> FindLastIndex(_size - 1, _size, match); 604if (_size == 0) 615if ((uint)startIndex >= (uint)_size) 647for (int i = 0; i < _size; i++) 685if (_size - index < count) 719=> Array.IndexOf(_items, item, 0, _size); 741if (index > _size) 743return Array.IndexOf(_items, item, index, _size - index); 757if (index > _size) 760if (count < 0 || index > _size - count) 773if ((uint)index > (uint)_size) 777if (_size == _items.Length) 781else if (index < _size) 783Array.Copy(_items, index, _items, index + 1, _size - index); 816if ((uint)index > (uint)_size) 826if (_items.Length - _size < count) 830else if (index < _size) 832Array.Copy(_items, index, _items, index + count, _size - index); 841Array.Copy(_items, index + count, _items, index * 2, _size - index); 873if (_size == 0) 879return LastIndexOf(item, _size - 1, _size); 894if (index >= _size) 920if (_size == 0) 925if (index >= _size) 972while (freeIndex < _size && !match(_items[freeIndex])) freeIndex++; 973if (freeIndex >= _size) return 0; 976while (current < _size) 979while (current < _size && match(_items[current])) current++; 981if (current < _size) 990Array.Clear(_items, freeIndex, _size - freeIndex); // Clear the elements so that the gc can reclaim the references. 993int result = _size - freeIndex; 1003if ((uint)index >= (uint)_size) 1008if (index < _size) 1010Array.Copy(_items, index + 1, _items, index, _size - index); 1014_items[_size] = default!; 1032if (_size - index < count) 1038if (index < _size) 1040Array.Copy(_items, index + count, _items, index, _size - index); 1046Array.Clear(_items, _size, count); 1072if (_size - index < count) 1112if (_size - index < count) 1129if (_size > 1) 1131ArraySortHelper<T>.Sort(new Span<T>(_items, 0, _size), comparison); 1140if (_size == 0) 1145T[] array = new T[_size]; 1146Array.Copy(_items, array, _size); 1162if (_size < threshold) 1164Capacity = _size; 1175for (int i = 0; i < _size; i++) 1208if (_version == localList._version && ((uint)_index < (uint)localList._size)) 1224_index = _list._size + 1; 1235if (_index == 0 || _index == _list._size + 1)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (3)
27int size = list._size; 130else if (count < list._size && RuntimeHelpers.IsReferenceOrContainsReferences<T>()) 132Array.Clear(list._items, count, list._size - count);