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