Table of Contents
API reference

Constructor MemoryBuffer

Namespace
DisCatSharp.Common.Types
Assembly
DisCatSharp.Common.dll

MemoryBuffer(int, int, MemoryPool<byte>?, bool)

Creates a new buffer with a specified segment size, specified number of initially-allocated segments, and supplied memory pool.

public MemoryBuffer(int segmentSize = 65536, int initialSegmentCount = 0, MemoryPool<byte>? memPool = null, bool clearOnDispose = false)

Parameters

segmentSize int

Byte size of an individual segment. Defaults to 64KiB.

initialSegmentCount int

Number of segments to allocate. Defaults to 0.

memPool MemoryPool<byte>

Memory pool to use for renting buffers. Defaults to Shared.

clearOnDispose bool

Determines whether the underlying buffers should be cleared on exit. If dealing with sensitive data, it might be a good idea to set this option to true.