ModernUO/Projects/UOContent/Mobiles
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
..
AI fix: Fixes speed issues (#959) 2022-03-15 10:18:27 -07:00
Animals fix: Fixes speed issues (#959) 2022-03-15 10:18:27 -07:00
Familiars fix: Cleans up LINQ calls. (#965) 2022-03-20 19:20:54 -07:00
Guards cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
Healers chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
Monsters feat: Adds a single threaded array pool (#967) 2022-03-22 09:58:24 -07:00
Special fix: Cleans up LINQ calls. (#965) 2022-03-20 19:20:54 -07:00
Townfolk fix: Round 3 of speed updates for NPCs (#963) 2022-03-18 12:56:42 -07:00
Vendors fix: Fixes speed issues (#959) 2022-03-15 10:18:27 -07:00
BaseCreature.cs fix: Round 3 of speed updates for NPCs (#963) 2022-03-18 12:56:42 -07:00
ChampionTitleInfo.cs fix(core): Caches DateTime.NowUtc (#548) 2021-03-13 01:32:04 -08:00
PlayerMobile.cs fix: Removes from literals (#893) 2021-12-24 15:56:07 -08:00