Enhance Profiler with pre-allocated sort buffers and frame management improvements
This commit is contained in:
@@ -78,6 +78,21 @@ public class BoundedQueue<T> : IEnumerable<T>, ICollection, IReadOnlyCollection<
|
||||
}
|
||||
}
|
||||
|
||||
// Iterates the internal Queue<T> directly (struct enumerator, no allocation) under the lock.
|
||||
public int CopyTo(List<T> destination)
|
||||
{
|
||||
lock (syncLock)
|
||||
{
|
||||
destination.Clear();
|
||||
foreach (T item in queue)
|
||||
{
|
||||
destination.Add(item);
|
||||
}
|
||||
|
||||
return destination.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
T[] snapshot;
|
||||
|
||||
Reference in New Issue
Block a user