1 write to s_list
System.Drawing.Common (1)
System\Drawing\Internal\SystemColorTracker.cs (1)
120
Array.Resize(ref
s_list
, s_list.Length * EXPAND_FACTOR);
22 references to s_list
System.Drawing.Common (22)
System\Drawing\Internal\SystemColorTracker.cs (22)
28
Debug.Assert(
s_list
is not null, "List is null");
29
Debug.Assert(
s_list
.Length > 0, "INITIAL_SIZE was initialized after list");
31
if (
s_list
.Length == s_count)
49
if (
s_list
[index] is not WeakReference<ISystemColorTracker> reference)
51
s_list
[index] = new(obj);
55
Debug.Assert(!reference.TryGetTarget(out _), $"Trying to reuse a weak reference that isn't broken yet: list[{index}], length = {
s_list
.Length}");
68
int right =
s_list
.Length - 1;
71
int length =
s_list
.Length;
77
while (left < length &&
s_list
[left]?.TryGetTarget(out _) == true)
79
while (right >= 0 &&
s_list
[right]?.TryGetTarget(out _) != true)
88
(
s_list
[right],
s_list
[left]) = (
s_list
[left],
s_list
[right]);
94
Debug.Assert(s_count >= 0 && s_count <=
s_list
.Length, "count not a legal index into list");
107
for (int i = s_count; i <
s_list
.Length; i++)
109
Debug.Assert(
s_list
[i]?.TryGetTarget(out _) == false, "Partitioning didn't work");
118
if (s_count / (float)
s_list
.Length > EXPAND_THRESHOLD)
120
Array.Resize(ref s_list,
s_list
.Length * EXPAND_FACTOR);
122
Debug.Assert(
s_list
.Length < WARNING_SIZE, "SystemColorTracker is using way more memory than expected.");
133
Debug.Assert(
s_list
[i] is not null, "null value in active part of list");
134
if (
s_list
[i]?.TryGetTarget(out ISystemColorTracker? target) == true)