Class MemoryPool
Provides a resource pool that enables reusing instances of arrays.
Inherited Members
Namespace: PoeShared.Services
Assembly: PoeShared.dll
Syntax
public sealed class MemoryPool : IMemoryPool, IArrayPool<byte>
Remarks
Internally uses ConfigurableArrayPool, as the expectation is that it will be used for large objects only(e.g. image canvases) as in all other cases it would make more sense to use ArrayPool.Shared (TlsOverPerCoreLockedStacksArrayPool) as it is more performant
Notes: TlsOverPerCoreLockedStacksArrayPool max array size is only 1MB, meaning that it does not work for large arrays, which is reasonable considering it uses threadlocal to store data
https://medium.com/@epeshk/the-big-performance-difference-between-arraypools-in-net-b25c9fc5e31d
Properties
Name | Description |
---|---|
Shared |
Methods
Name | Description |
---|---|
Rent(int) | |
RentPinnedBuffer(int) | |
Return(byte[]) | |
Return(char[]) |