Class MemoryPool<T>
- Namespace
- MarymoorStudios.Core
- Assembly
- MarymoorStudios.Core.dll
A pool of memory blocks.
public abstract class MemoryPool<T> : IDisposable where T : unmanaged
Type Parameters
T
- Inheritance
-
MemoryPool<T>
- Implements
- Derived
- Inherited Members
Constructors
MemoryPool()
protected MemoryPool()
Properties
MaxSize
Returns the maximum buffer size supported by this pool.
public abstract int MaxSize { get; }
Property Value
Remarks
The buffer size is the maximum number of T
elements that a memory can contain.
Methods
Dispose()
public void Dispose()
Dispose(bool)
Implements standard Dispose-pattern.
protected abstract void Dispose(bool disposing)
Parameters
disposing
boolTrue if disposing, false if finalizing.
Remarks
When disposing
is true then managed resources should be released. When
disposing
is false then the object has already gone through garbage collection and only
native resources should be touched.
~MemoryPool()
protected ~MemoryPool()
GetMemory()
public abstract OwnedMem<T> GetMemory()
Returns
- OwnedMem<T>
GetMemory(int)
Returns Memory<T> of size size
.
public OwnedMem<T> GetMemory(int size)
Parameters
size
int
Returns
- OwnedMem<T>