Make MemoryAllocator limits configurable and extensible
Merged
JI
2mo ago+346+346+012345678901234567890123456789-12-12-01234567890123456789
Prerequisites
- I have written a descriptive pull-request title
- I have verified that there are no overlapping pull-requests open
- I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
- I have provided test coverage for my change (where applicable)
Description
The allocation limits on MemoryAllocator were internal with no public way to raise the 1 GB single-buffer default, and ApplyOptions was not callable from external subclasses, which blocked custom allocators.
- Expose
MemoryGroupAllocationLimitBytes,SingleBufferAllocationLimitBytes, andAccumulativeAllocationLimitByteswith validated protected setters. - Make
ApplyOptionsprotected so derived allocators can accept options. - Add
MemoryAllocatorOptions.SingleBufferAllocationLimitMegabytesto raise the contiguous buffer cap up to 2047 MB without a custom allocator. - Add public-api tests that implement a complete external allocator.
- Add behavior tests for the new option and its validation.