Table of Contents

Class SlabMemoryPool<T>

Namespace
MarymoorStudios.Core
Assembly
MarymoorStudios.Core.dll
public sealed class SlabMemoryPool<T> : MemoryPool<T>, IDisposable where T : unmanaged

Type Parameters

T
Inheritance
SlabMemoryPool<T>
Implements
Inherited Members

Constructors

SlabMemoryPool(int, int)

public SlabMemoryPool(int maxSize, int chunksPerSlab)

Parameters

maxSize int
chunksPerSlab int

Properties

MaxSize

Returns the maximum buffer size supported by this pool.

public override int MaxSize { get; }

Property Value

int

Remarks

The buffer size is the maximum number of T elements that a memory can contain.

Note: This value must be constant for the lifetime of the pool.

Methods

Dispose(bool)

Implements standard Dispose-pattern.

protected override void Dispose(bool disposing)

Parameters

disposing bool

True 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.

GetMemory()

Returns Memory<T> of size MaxSize.

public override OwnedMem<T> GetMemory()

Returns

OwnedMem<T>