19 for (
int i = 0; i <
array.Length; i++)
77 private readonly T[][]
_arrays =
new T[8][];
111 if ((uint)num < (uint)
arrays.Length)
154 if (
Unsafe.SizeOf<T>() > 16)
158 if (
Unsafe.SizeOf<T>() > 32)
204 private int Id => GetHashCode();
218 if (
array !=
null && (uint)num < (uint)
array.Length)
223 array[num].Array =
null;
232 if ((uint)num < (uint)buckets.Length)
253 return Array.Empty<T>();
263 int hashCode =
array2.GetHashCode();
280 if ((uint)num < (uint)
array2.Length)
301 if (
log.IsEnabled() &&
array.Length != 0)
304 if (!(flag &&
flag2))
321 for (
int i = 0; i < buckets.Length; i++)
332 for (
int j = 0;
j <
key.Length;
j++)
357 for (
int k = 0;
k <
key2.Length;
k++)
366 key2[
k].MillisecondsTimeStamp = tickCount;
static unsafe void Clear(Array array)
static readonly ArrayPoolEventSource Log
void Trim(int currentMilliseconds, int id, Utilities.MemoryPressure pressure, int bucketSize)
int _millisecondsTimestamp
readonly LockedStack[] _perCoreStacks
void Trim(int currentMilliseconds, int id, Utilities.MemoryPressure pressure, int bucketSize)
static readonly int s_lockedStackCount
override T[] Rent(int minimumLength)
override void Return(T[] array, bool clearArray=false)
static ThreadLocalArray[] t_tlsBuckets
ThreadLocalArray[] InitializeTlsBucketsAndTrimming()
readonly ConditionalWeakTable< ThreadLocalArray[], object > _allTlsBuckets
readonly PerCoreLockedStacks[] _buckets
PerCoreLockedStacks CreatePerCoreLockedStacks(int bucketIndex)
static int GetMaxSizeForBucket(int binIndex)
static int SelectBucketIndex(int bufferSize)
static MemoryPressure GetMemoryPressure()
void Add(TKey key, TValue value)
static int ProcessorCount
static void Register(Func< bool > callback)
static byte Min(byte val1, byte val2)
static string ArgumentException_BufferNotFromPool
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static void Exit(object obj)
static void Enter(object obj)
static int GetCurrentProcessorId()
static void ThrowArgumentNullException(string name)
int MillisecondsTimeStamp
ThreadLocalArray(T[] array)