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