Add optimized AddRange overloads for recyclable collections

This commit is contained in:
Marek Lemańczyk committed 2025-07-14 17:30:16 +02:00
1 parent e1298c817d
commit f4e2285734
10 files changed
+723 -84

No files matched your search

+5 -5
View File
@@ -7,7 +7,7 @@ namespace Recyclable.Collections
{
internal sealed class RecyclableStack<T> : IEnumerable<T>, IDisposable
{
private static readonly bool _needsClearing = !typeof(T).IsValueType;
internal static readonly bool _needsClearing = !typeof(T).IsValueType;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static RecyclableArrayPoolChunk<T> RentChunk(int size, RecyclableArrayPoolChunk<T>? previous)
@@ -42,10 +42,10 @@ namespace Recyclable.Collections
RecyclableArrayPoolChunkPool<T>.Dispose(chunk, _needsClearing);
}
private RecyclableArrayPoolChunk<T> _current;
private bool _disposed;
private long _capacity;
private long _count;
internal RecyclableArrayPoolChunk<T> _current;
internal bool _disposed;
internal long _capacity;
internal long _count;
public RecyclableStack(int initialCapacity = RecyclableDefaults.InitialCapacity)
{