ArrayPool<T> replaced with ThreadStaticPools

This commit is contained in:
mlemanczyk committed 2025-11-07 00:46:16 +01:00
1 parent c004e140db
commit 9537addf38
12 files changed
+123 -75

No files matched your search

+3 -2
View File
@@ -42,7 +42,8 @@ public sealed class PrimeCache
index = ~index;
}
EInteger[] primesArray = ArrayPool<EInteger>.Shared.Rent(_primes.Count);
ArrayPool<EInteger> eIntegerPool = ThreadStaticPools.EIntegerPool;
EInteger[] primesArray = eIntegerPool.Rent(_primes.Count);
try
{
Span<EInteger> primes = new(primesArray);
@@ -64,7 +65,7 @@ public sealed class PrimeCache
}
finally
{
ArrayPool<EInteger>.Shared.Return(primesArray);
eIntegerPool.Return(primesArray);
}
}