ModernUO/Projects/Server/Collections
Kamron Batman 76fddcbccd
feat: Adds a single threaded array pool (#967)
## Added Feature
Adds a single threaded array pool that works exactly the same as `ArrayPool<T>.Shared`.
The `STArrayPool<T>.Shared` can only be used on a single thread, the main game thread of the server.

Note: Unlike the built-in array pool, there is no hook into the _GC Gen 2_. This means to relieve potentially high memory pressure, `ArrayPool<T>.Shared.Trim()` must be called. The pool will only release arrays _after two successive calls within 10 seconds or longer_. If the server is at less than 70% total memory usage, or the server is not going to use this pool for something egregious, then don't bother ever calling Trim().


## Changes
- [X] Fixes ArrayPool calls that should be cleared due to references.
- [X] Benchmarks against ArrayPool with 4+ rented arrays deep of the same length.
- [x] Unit tests
2022-03-22 09:58:24 -07:00
..
ArrayEnumerator.cs fix(core): Fixes type caching & cleanup (#422) 2021-01-20 00:10:33 -08:00
BitArray.cs fix: Adds BitArray support with codegen (#888) 2021-12-13 09:31:02 -08:00
CollectionHelpers.cs fix: Optimize OrderedHashSet and introduce more high perf collections (#679) 2021-08-08 21:37:25 -07:00
CollectionThrowStrings.cs fix: Adds BitArray support with codegen (#888) 2021-12-13 09:31:02 -08:00
HashHelpers.cs fix(core): Adds ability to store null value in ordered hash set (#447) 2021-02-03 17:57:03 -08:00
OrderedHashSet.cs fix: Optimize OrderedHashSet and introduce more high perf collections (#679) 2021-08-08 21:37:25 -07:00
PooledOrderedHashSet.cs fix: Optimize OrderedHashSet and introduce more high perf collections (#679) 2021-08-08 21:37:25 -07:00
PooledRefQueue.cs feat: Adds a single threaded array pool (#967) 2022-03-22 09:58:24 -07:00
STArrayPool.cs feat: Adds a single threaded array pool (#967) 2022-03-22 09:58:24 -07:00