Clean up shared ArrayPool naming and add some env var config (#86109)
authorStephen Toub <stoub@microsoft.com>
Thu, 11 May 2023 23:56:43 +0000 (19:56 -0400)
committerGitHub <noreply@github.com>
Thu, 11 May 2023 23:56:43 +0000 (19:56 -0400)
commit43d6cb0caa8edf544da2d24711659956dd3c7f21
treeb26d27d51164edbb3678dcfa88cb0410cee9fe53
parent256bf67b969c56f8b3e87c506eb613cce36e778f
Clean up shared ArrayPool naming and add some env var config (#86109)

* Clean up shared ArrayPool naming and add some env var config

We've had several requests to be able to tweak / experiment with how many arrays the shared array pool might store.  This adds two environment variables, one that controls the number of partitions the shared pool uses, and one that controls the number of arrays cacheable in each partition.  Previously these values were constants.

As part of doing that, I needed to choose names that were a bit more palatable for external consumption, and I renamed thngs in the implementation accordingly.

* Rename file to SharedArrayPool.cs

* Fix naming scheme

* Avoid using globalization

* Avoid using Environment.GetEnvironmentVariable

* Move nopool env var into Environment

* Move static readonly fields to statics type
src/libraries/System.Buffers/tests/ArrayPool/UnitTests.cs
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Buffers/ArrayPool.cs
src/libraries/System.Private.CoreLib/src/System/Buffers/SharedArrayPool.cs [moved from src/libraries/System.Private.CoreLib/src/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs with 68% similarity]
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Unix.cs
src/libraries/System.Private.CoreLib/src/System/Environment.Variables.Windows.cs